This closes #631 ARTEMIS-629 Preserve the correlation ID type during conversions

This commit is contained in:
Andy Taylor 2016-07-14 10:08:55 +01:00
commit d7edf06689
2 changed files with 9 additions and 2 deletions

View File

@ -215,7 +215,7 @@ public abstract class InboundTransformer {
jms.setJMSReplyTo(vendor.createDestination(properties.getReplyTo()));
}
if (properties.getCorrelationId() != null) {
jms.setJMSCorrelationID(properties.getCorrelationId().toString());
jms.setJMSCorrelationID(AMQPMessageIdHelper.INSTANCE.toBaseMessageIdString(properties.getCorrelationId()));
}
if (properties.getContentType() != null) {
jms.setStringProperty(prefixVendor + "ContentType", properties.getContentType().toString());

View File

@ -176,7 +176,14 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
maMap.put(LEGACY_JMS_REPLY_TO_TYPE_MSG_ANNOTATION, destinationAttributes(msg.getJMSReplyTo()));
}
if (msg.getJMSCorrelationID() != null) {
props.setCorrelationId(msg.getJMSCorrelationID());
String correlationId = msg.getJMSCorrelationID();
try {
props.setCorrelationId(AMQPMessageIdHelper.INSTANCE.toIdObject(correlationId));
}
catch (ActiveMQAMQPIllegalStateException e) {
props.setCorrelationId(correlationId);
}
}
if (msg.getJMSExpiration() != 0) {
long ttl = msg.getJMSExpiration() - System.currentTimeMillis();