Example usage for org.springframework.messaging.handler DestinationPatternsMessageCondition LOOKUP_DESTINATION_HEADER

List of usage examples for org.springframework.messaging.handler DestinationPatternsMessageCondition LOOKUP_DESTINATION_HEADER

Introduction

In this page you can find the example usage for org.springframework.messaging.handler DestinationPatternsMessageCondition LOOKUP_DESTINATION_HEADER.

Prototype

String LOOKUP_DESTINATION_HEADER

To view the source code for org.springframework.messaging.handler DestinationPatternsMessageCondition LOOKUP_DESTINATION_HEADER.

Click Source Link

Document

The name of the "lookup destination" header.

Usage

From source file:org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.java

@Override
public void handleMessage(Message<?> message) throws MessagingException {
    String destination = getDestination(message);
    if (destination == null) {
        return;/*  w w w.j  a v  a  2s  .com*/
    }
    String lookupDestination = getLookupDestination(destination);
    if (lookupDestination == null) {
        return;
    }
    MessageHeaderAccessor headerAccessor = MessageHeaderAccessor.getMutableAccessor(message);
    headerAccessor.setHeader(DestinationPatternsMessageCondition.LOOKUP_DESTINATION_HEADER, lookupDestination);
    headerAccessor.setLeaveMutable(true);
    message = MessageBuilder.createMessage(message.getPayload(), headerAccessor.getMessageHeaders());

    if (logger.isDebugEnabled()) {
        logger.debug("Searching methods to handle " + headerAccessor.getShortLogMessage(message.getPayload())
                + ", lookupDestination='" + lookupDestination + "'");
    }

    handleMessageInternal(message, lookupDestination);
    headerAccessor.setImmutable();
}