Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB and JMS - creating a unique message ID  RSS feed

 
Nathan England
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a stateless session bean which will use JMS to put a request message on a queue and read a reply from another JMS queue.

I need to figure out a way to get (or generate) a unique id for the message's messageId (and reply I will be looking for the unique ID in the correlation ID field in the message reply).

What is the best practice to get, or generate a unique message ID? Can I retrieve client information from the client or is it better to generate my own unique id? My clients in this case, will be from another web service (web page) which will be launched in a browser.
-Nathan
 
Jinal Sh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
It would be better if you generate your own ID that would make it possible for both to mutually coordinate. If you still need any help do let me know.

Regards
 
Nathan England
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I ended up doing, was after I did the producer.send() message, I grabbed the msgID (it appears to have an auto-generated ID after you send the message)

I then saved this generated msgID and used it to filter for a correlID and it works great.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!