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