Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMS and Unique ServerID

 
Russ Ray
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple application that uses a JMS message to update other clustered members of the application. This is a pub/sub scenario. In an effort to prevent duplication of work, I use VMID SERVER_ID = new VMID() to obtain the unique ID for the server who originated the message. I post this information on the queue with no problem. When the message comes off the queue, the MDB takes the current serverID by using VMID SERVER_ID = new VMID(). Next, I compare the two ids.

This application is running on my box, a single JVM/Server, but for some reason I get two separate ServerIDs.

Current ServerID[3c39e4d1cb654eef:39963df5:10563d911b1:-7ffd]
Originating ServerID[3c39e4d1cb654eef:39963df5:10563d911b1:-7ffc]

Am I misusing VMID?

Thanks for your help.

Russ
 
Russell Ray
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the good of the group:

VMID is an enterprise way of gaining a unique id. Therefore, each time you can the constructor, a unique id is generated.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic