Hi,

I'm trying to implement the following simple pattern using ActiveMQ:
 - my server maintains a "state"
 - my clients connect to the server, get a snapshot of the state and
suscribe to updates of the state

So I need the "state snapshot + subscription" step to be atomic for each
client connecting to the updates topic.

So far the only solution I can think of is:
 - put an absolute sequence number on update messages
 - use separate temporary queues for state snapshot requests (like
described here:
http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html
)
 - each state snapshot is tagged with the sequence number of the
corresponding update
 - when a client connects, it suscribes first to the updates topic, then
requests the snapshot state, and just discards updates that are older than
the snapshot state

I feel there might be a smarter solution, as strict ordering is built in
the framework ? Or maybe using advisory messages ?

Thanks,
Julien

Reply via email to