Ehcache Distributed Multiple Channel

I am using ehcache in ditributed mode. Caches are synchronized across channels.

<cacheManagerPeerProviderFactory
    class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
    properties="channelName=CHANNEL1:connect=UDP(mcast_port=45568)"
    propertySeparator=":" />

For the new requirement, I need to synchronize with two channels: CHANNEL1 and CHANNEL2.

Is it possible? if so, how can I do this?

Thanks in advance

+4
source share
1 answer

Typically, one cacheManagerPeerProviderFactory instance is used to replicate (or synchronize) the number of caches in a cluster. In this case, "channelName=CHANNEL1:"more like a simple name. I do not think ehCache supports multiple channels.

If you need to have a specific replication channel, you can try one of the following

  • EhCache , ehcache.xml, .
  • , ehcache.xml , ( ) .

-, . EhcacheManagers Spring :

<ehcache:annotation-driven cache-manager="ehCacheManager1" />

<bean id="ehCacheManager1" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="configLocation" value="classpath:ehcache-1.xml" />
</bean>

<bean id="ehCacheManager2" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="configLocation" value="classpath:ehcache-2.xml" />
</bean>
+1

All Articles