[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Delayed cache replication using RMI Cache replication on other node  XML
Forum Index -> Ehcache
Author Message
bgarg

neo

Joined: 07/04/2014 04:00:27
Messages: 2
Offline

Please refer the below configurations used on both the nodes:


Node1
-------

<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//node1:50001/wiInputMessageCache"/>

<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=node2, port=50001, socketTimeoutMillis=2000"/>


<cache name="wiInputMessageCache"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="18000"
timeToLiveSeconds="18000"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true,
replicateRemovals=true, asynchronousReplicationIntervalMillis=10"/>

<bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
</cache>



Node2
--------
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//node2:50001/wiInputMessageCache"/>

<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=node1, port=50001, socketTimeoutMillis=2000"/>


<cache name="wiInputMessageCache"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="18000"
timeToLiveSeconds="18000"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true,
replicateRemovals=true, asynchronousReplicationIntervalMillis=10"/>

<bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
</cache>



Log Snippet:
----------------
We are using JMS Listener. The request is first received on Node1 but the response is listened on Node2. As as fall back we are storing the cached object into the database. On Node2 it is always picking the cached object from database as it received the replication put notification from Node1 post querying the database. Changed the asynchronousReplicationIntervalMillis=10, but still the same issue.


Refer below log snippet:


Line 18: DEBUG [2014-07-02 09:29:32,356][wiOutputContainer-5] Executing SQL query [SELECT * FROM INPUT_MSG_CACHE WHERE MSG_ID=6952047]
Line 54: INFO [2014-07-02 09:29:32,369][wiOutputContainer-5] Total time to process message with requestId(6952047): 13.709004
Line 298: DEBUG [2014-07-02 09:29:32,601][RMI TCP Connection(389)-5.229.10.56] RMICachePeer for cache wiInputMessageCache: remote put received[b]. Element is: [ key = 6952047, value=WiInputMsgCache: inputs [[com.test.TravellerInput@8c6752c]] summary[com.test.Summary@1d36a034] aprcReceivedTime[0] source[ABC] userName[], version=1, hitCount=0, CreationTime = 1404289773000, LastAccessTime = 1404289772601 ]



Please suggest. Need urgent support. Many thanks.
bgarg

neo

Joined: 07/04/2014 04:00:27
Messages: 2
Offline

bgarg wrote:
Please refer the below configurations used on both the nodes:


Node1
-------

<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//node1:50001/wiInputMessageCache"/>

<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=node2, port=50001, socketTimeoutMillis=2000"/>


<cache name="wiInputMessageCache"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="18000"
timeToLiveSeconds="18000"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true,
replicateRemovals=true, asynchronousReplicationIntervalMillis=10"/>

<bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
</cache>



Node2
--------
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//node2:50001/wiInputMessageCache"/>

<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=node1, port=50001, socketTimeoutMillis=2000"/>


<cache name="wiInputMessageCache"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="18000"
timeToLiveSeconds="18000"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true,
replicateRemovals=true, asynchronousReplicationIntervalMillis=10"/>

<bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/>
</cache>



Log Snippet:
----------------
We are using JMS Listener. The request is first received on Node1 but the response is listened on Node2. As as fall back we are storing the cached object into the database. On Node2 it is always picking the cached object from database as it received the replication put notification from Node1 post querying the database. Changed the asynchronousReplicationIntervalMillis=10, but still the same issue.


Refer below log snippet:


Line 18: DEBUG [2014-07-02 09:29:32,356][wiOutputContainer-5] Executing SQL query [SELECT * FROM INPUT_MSG_CACHE WHERE MSG_ID=6952047]
Line 54: INFO [2014-07-02 09:29:32,369][wiOutputContainer-5] Total time to process message with requestId(6952047): 13.709004
Line 298: DEBUG [2014-07-02 09:29:32,601][RMI TCP Connection(389)-5.229.10.56] RMICachePeer for cache wiInputMessageCache: remote put received[b]. Element is: [ key = 6952047, value=WiInputMsgCache: inputs [[com.test.TravellerInput@8c6752c]] summary[com.test.Summary@1d36a034] aprcReceivedTime[0] source[ABC] userName[], version=1, hitCount=0, CreationTime = 1404289773000, LastAccessTime = 1404289772601 ]



Please suggest. Need urgent support. Many thanks.
 
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team