views:

18

answers:

2

Hi guys,

I've set up EHCache with its stock suggestion on how to set up multicast:

<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
    properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=4446"/>
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" 
    properties="port=40001, socketTimeoutMillis=2000"/>

Then I fire my app up on two machines. How can I see whether they discover one-another and invalidate one-anothers caches?

Cheers

Nik

+1  A: 

Have you tried to look at any logging produced by EhCache? This would seem like a good place to start.

matt b
Yes, it has no comment, no log entries that I could find the IP of the other machine, when I hit ctrl-c it says that it disconnected from 0 peers
niklassaers
A: 

It seems that just enabling this does not make the caches distributed. For each cache, add something like the following:

   <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true"/>
   <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" properties="bootstrapAsynchronously=true, maximumChunkSizeBytes=5000000"/>

Then it starts ticking just fine.

niklassaers