0

We have an application using Apache Camel 2.15.2 and Apache Qpid 0.4.0 that sends and receives messages over Amqp to a Microsoft Service Bus 1.1.

We upgraded Qpid recently from the older Qpid 0.32 and now we have a problem that we cannot set the messageId of the AMQP message to a UUID which is the requirement of the receiver. The messageId that is set is instead a string created in the JmsSession-class within Qpid. For example it looks like: "CLIENT115-61957-114498109876-0:15:1-1"

In this file: https://github.com/apache/qpid-jms/blob/master/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java we can see the following:

  1. On row 709 the messageId is created by calling the method getNextMessageId(producer)
  2. On row 923 we see that this messageId is generated by using the producers id and a message sequence.

This could never produce a message id formatted as a UUID. Am I missing something or is it simply not possible to set the messageId to a UUID using Apache QPID?

P3anuts
  • 461
  • 1
  • 9
  • 24

1 Answers1

1

The client does not and can not set a UUID as the MessageID and you should never depend on the JMSMessageID value being a specific format as this is a vendor specific value which can and will be different between differing JMS client libraries.

If your applications depend on messages having a specific ID assigned to them that can be correlated by your receiver application then you should use message properties for this as that's what they are there for.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42
  • Thanks for your reply! Our problem is that we have a message specification issued that all suppliers must follow and that specifciation states that messageId should be in UUID format. At this stage, I think it can be hard to change the specification which puts us in a tricky situation. – P3anuts Sep 03 '15 at 07:38
  • I'm pretty sure all the implementors of JMS clients will not be agree to modify their client implementations to meet your business specifications. – Tim Bish Sep 03 '15 at 14:51
  • I am aware of that, but I opened an issue for this anyway. Since this worked in previous versions I think it would be nice if it could work now as well. It will be interesting to see how this issue is handled. https://issues.apache.org/jira/browse/QPIDJMS-105 – P3anuts Sep 03 '15 at 18:12
  • It is important to keep in mind that the new client is not the old client, and if in the future you change to some other JMS client, it will break yet again. – Tim Bish Sep 03 '15 at 18:17