We use a JMS topic to coordinate distributed caches.  We have a topic called
"caching" using non-persistent messages.  The subscribers are (of course)
non-durable.

A message in the topic means "clear your cache for the specified datatype
(and id)".  Multiple webapps subscribe to this topic (and also publish). 
When a webapp makes a change to a piece of data, it publishes a message to
the topic to tell the other webapps to clear their cache for that particular
piece of data.  In this way we enforce cache consistency.

We are using a "Shared filesystem Master/Slave" using kahadb.  If the master
fails, then the clients are notified via the ActiveMQ TransportListener
mechanism.  When the connection is determined to be lost (via the
TransportListener), each client clears ALL ENTRIES in it's cache.  When the
connection is reestablished, the cache will be refilled naturally.  This
keeps the cache consistent in the face of a broker failure.

We contemplated using persistent messaging and durable subscribers for this
scheme, to make sure no message were lost. I am thinking that we do not need
to pay the price for persistence and instead use the above scheme based on
TransportListener.

Can you see any faults in this approach?

Thanks!



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Depending-on-TransportListener-for-cache-consistency-tp4700535.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to