Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a JMS Correlation ID

Tags:

jms

It is generally discouraged to use the message id returned from the JMS provider as the correlation id with which a message is published onto a queue. How have people generated their correlation ids for a request/response architecture?

like image 644
onejigtwojig Avatar asked Nov 04 '10 21:11

onejigtwojig


1 Answers

Clients can use a unique ID standard like UUID to generate a new ID. Here is good tutorial for you.

You can return correlation id from JMS provider using following code.

message.setJMSCorrelationID(UUID.randomUUID().toString());
producer.send(message);
LOG.info("jms-client sent:" + message.getJMSCorrelationID());  

Cheers.

like image 160
Sandip Armal Patil Avatar answered Oct 23 '22 04:10

Sandip Armal Patil