I am developing a jboss Java EE application where I need to send messages through a messaging system (JMS or AMQP optional). Approx. there will be around 10k to 15k messages per second. The requirement is to generate a unique id for each outgoing message that is not used any time in the past, even after application restart i.e. the id should not repeat again through the application lifetime (from day 1 of application use until decommissioned)
I will prefer solutions based on
The auto-generation of the id should be atomic.
Java provides a method for generating Universally Unique Identifiers in the UUID class
Wikipedia has an explanation why the probability that these generate a message with the same ID is negligible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With