Hello!
If I set the value of the custom header to UUID.toString(), then it is still intact
Frankly speaking, you're going the right way.
The real issue is here: org.springframework.integration.jms.DefaultJmsHead erMapper.SUPPORTED_PROPERTY_TYPES
There is no supported type for java.util.UUID.
So, I recommend you write some custom JmsHeaderMapper:
Code:
public class CorrelationIdJmsHeaderMapper extends DefaultJmsHeaderMapper {
public void fromHeaders(MessageHeaders headers, javax.jms.Message jmsMessage) {
super.fromHeaders(headers, jmsMessage);
Object correlationId = headers.get(MessageHeaders.CORRELATION_ID);
if (correlationId != null) {
try {
jmsMessage.setStringProperty("correlationId", correlationId.toString());
}
catch (Exception e) {
throw new MessagingException("Problem setting 'correlationId' property", e);
}
}
}
}
And use like this:
HTML Code:
<jms:outbound-channel-adapter destination="someDestination" header-mapper="correlationIdJmsHeaderMapper"/>
However you can raise new JIRA issue https://jira.springsource.org/browse/INT and we will think what to do in the framework.
Cheers,
Artem