This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Synchronizing RMI and JMS communication channels Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Synchronizing RMI and JMS communication channels" Watch "Synchronizing RMI and JMS communication channels" New topic
Author

Synchronizing RMI and JMS communication channels

Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
My trading application is working as follows:
When a user "logs in" (I'm using this as a generic term for initiating interest in a particular data set), an RMI call is made to the EJB server to get a snapshot of the data set.
Changes to the data set (e.g. add/remove) are communicated through JMS. The client registers as a JMS listener just before making the above RMI call.
Clearly there is a synchronization issue. If I get the remove message before I get the item in data set, I'll ignore the remove message, and subsequently have an entry which will never be removed.
Surely there is a pattern for avoiding this. Anyone fmailiar with it?
I could save all update messages between when I send the first registration message, and when I actually get the data (by which point I'm confident that I will be receiving updates) and simply "replay" them once the data set has been retrieved, but this seems like a band aid. Any other ideas?
--Mark
 
Have you checked out Aspose?
 
subject: Synchronizing RMI and JMS communication channels
 
jQuery in Action, 3rd edition