"timfox" wrote : "jmesnil" wrote :
| | It seems the bottleneck is the generation of the UUID.
| |
| | When using UUID.randomUUID(), the implementation uses a SecureRandom.
| | If I use Random instead and creates the UUID with new UUID(rand.nextLong(),
nextLong(), the perf increases significantely.
| |
|
| I don't think we should be using random UUIDs at all, since they're... well
random (so can clash).
|
| Instead I think we should use a variant 2 UUID.
After thinking a little about it, I think we do not uniquely identify the right object.
We do not need to generate a UUID for every message. We should instead generate a UUID for
our MessageProducer and append a sequence number for each message sent by this producer.
This means we only need to generate a single UUID per producer. This so significantely
reduces the number of generated ID that I think we can consider using a Random UUID with a
unsignificant risk of clash.
If we do that our message ID will have the format: "ID:<producer
uuid>:<sequence number>"
wdyt?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150963#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...