Search in sources :

Example 1 with MessagePostProcessor

use of org.springframework.jms.core.MessagePostProcessor in project spring-integration by spring-projects.

the class JmsSendingMessageHandler method handleMessageInternal.

@Override
protected void handleMessageInternal(final Message<?> message) throws Exception {
    if (message == null) {
        throw new IllegalArgumentException("message must not be null");
    }
    Object destination = this.determineDestination(message);
    Object objectToSend = (this.extractPayload) ? message.getPayload() : message;
    MessagePostProcessor messagePostProcessor = new HeaderMappingMessagePostProcessor(message, this.headerMapper);
    try {
        DynamicJmsTemplateProperties.setPriority(new IntegrationMessageHeaderAccessor(message).getPriority());
        this.send(destination, objectToSend, messagePostProcessor);
    } finally {
        DynamicJmsTemplateProperties.clearPriority();
    }
}
Also used : IntegrationMessageHeaderAccessor(org.springframework.integration.IntegrationMessageHeaderAccessor) MessagePostProcessor(org.springframework.jms.core.MessagePostProcessor)

Aggregations

IntegrationMessageHeaderAccessor (org.springframework.integration.IntegrationMessageHeaderAccessor)1 MessagePostProcessor (org.springframework.jms.core.MessagePostProcessor)1