Is JMSMessageID unique?

Posted by Admin on 14-Apr-2009 03:18

Hi,

I want to know if the property JMSMessageID can be unique even if there is many messages sent ( 10 000 messages sent a day).

Then, is the JMSMessageID property unique even if messages are sent between multiple domains?

Thanks.

Amine

All Replies

Posted by Bill Wood on 11-Oct-2009 08:58

Yes, the JMSMessageID is unique across the cases you are mentioning.  It is composed of 3 parts - eg. - ID:fffffffcded018a:71f0001:108FD68F1A.

  • the first part -  fffffffcded018a  - is a hash of the broker name (eg. Broker1)
  • the second part - 71f0001 - is generated from the connection (i.e. unique user) and a count of the messages sent on that connection
  • the third part  -  108FD68F1A  --   is from the timestamp

Given this you can have messages across different brokers without any duplication.

For the second part (71f0001) it is composed of two things:

   an id of the  connection assigned by the broker when the connection is made.

(3 chars   = 16^3 combinations) = ~4K)

   And an incrementing  number for the number of messages sent on the  connection

            (4 chars  –  16^4 combinations = ~ 64K)

The middle part would eventually recycle, but the timestamp (part 3) makes it unique.

This thread is closed