Example usage for org.springframework.messaging.support MessageHeaderAccessor getShortLogMessage

List of usage examples for org.springframework.messaging.support MessageHeaderAccessor getShortLogMessage

Introduction

In this page you can find the example usage for org.springframework.messaging.support MessageHeaderAccessor getShortLogMessage.

Prototype

public String getShortLogMessage(Object payload) 

Source Link

Document

Return a concise message for logging purposes.

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;/*from  ww  w .jav  a2  s  . c om*/
    }
    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();
}