It is globally unique across all machines.
But don't rely on that if you want to port to something
other than jboss.
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 ?
Is it unique accross the time as well?
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.
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.