5 Replies Latest reply on Aug 4, 2003 1:08 PM by adrian.brock

    How unique is MessageID in JBossMQ ?

    sankotm

      Heya,
      I'd like to ask how unique is MessageID generated for sent JMS messages.

      JMS spec states that scope of uniqueness it is up to the provider. It also states that scope should at least cover "connected set of message routers", which definition isn't too clear to me.

      How unique is MessageID in JBossMQ and what is it created from (IP, time....) ?

      Cheers

      Michal

        • 1. Re: How unique is MessageID in JBossMQ ?

          It is globally unique across all machines.
          But don't rely on that if you want to port to something
          other than jboss.

          Regards,
          Adrian

          • 2. Re: How unique is MessageID in JBossMQ ?
            sankotm

            ok. Source code (v3.2.1) shows that it uses ClientID, System time and sequence number (lastMessageID).
            that doesn't seem too globally unique.

            can it not happen that there are two clients with the same id ?

            Michal

            • 3. Re: How unique is MessageID in JBossMQ ?

              Is it unique accross the time as well?

              • 4. Re: How unique is MessageID in JBossMQ ?
                bmadigan2003

                That depends on how ClientID is generated. In a UUID, it would be based on a machine's MAC address. This is not done here I think, because a message ID does not need to be a UUID (and it would require a JNI call). Two clients with the same name probably could not communicate because there would be no way to differentiate between the two. So, IMHO the method for generating messageIds is sufficient.

                • 5. Re: How unique is MessageID in JBossMQ ?

                  The same ClientID cannot be connected twice concurrently.
                  So client id and time should be enough.

                  If you have some use case where two different
                  machines use the same ClientID close together
                  and the times are not in synch then it might be possible
                  to get a collision.

                  But even in this case, the JBoss server won't be confused
                  because the first connection has to be disconnected before
                  the second can reconnect.

                  Regards,
                  Adrian