Hi, we're experiencing some difficulty getting JCS (3.2) remote RMI cache to 
work properly. I'm having trouble finding a full working example of the remote 
RMI cache setup. I'd appreciate it if someone could point me in the right 
direction. Thank you! -Greg


  1.  Our clients are initiating 2 PUTs in quick succession. The server 
recognizes both, but only stores the first. I'm seeing the following in the 
remote server log, for the second PUT (note the "remove node" statement which 
does not occur during the first PUT)-

DEBUG | [RMI TCP Connection(138)-192.168.2.100] log.Log4j2LogAdapter 
(Log4j2LogAdapter.java:57) - In update, put [key1] in [cache2]

DEBUG | [RMI TCP Connection(138)-192.168.2.100] log.Log4j2LogAdapter 
(Log4j2LogAdapter.java:112) - In update, requesterId = [7] fromCluster = false

DEBUG | [RMI TCP Connection(138)-192.168.2.100] log.Log4j2LogAdapter 
(Log4j2LogAdapter.java:112) - Put NOT from cluster, updating other auxiliaries 
for region.  requesterId [7]

DEBUG | [RMI TCP Connection(138)-192.168.2.100] log.Log4j2LogAdapter 
(Log4j2LogAdapter.java:55) - Updating memory cache key1

DEBUG | [RMI TCP Connection(138)-192.168.2.100] log.Log4j2LogAdapter 
(Log4j2LogAdapter.java:89) - removing node

  1.  When a client initiates a REMOVE, the remote server recognizes and 
removes its own inmem entry, but that event does not appear to be broadcast to 
the OTHER clients. This results in the other clients being out of sync with the 
remote server.

Setup/Config details-
The cache server is running within the same app server (Wildfly) as the 
clients. There are 2 cache regions configured in the clients.

In our code, we're using CacheAccess<String, CustomValue>, where CustomValue 
class is fully serializable.

The client config is as follows-
# ################# CLIENT CONFIG  #####################
jcs.default=RC
jcs.default.cacheattributes=org.apache.commons.jcs3.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs3.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=true
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.elementattributes=org.apache.commons.jcs3.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLife=700
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true

jcs.region.cache1=RC
jcs.region.cache2=RC

jcs.auxiliary.RC=org.apache.commons.jcs3.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RC.attributes=org.apache.commons.jcs3.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RC.attributes.FailoverServers=localhost:1101
jcs.auxiliary.RC.attributes.LocalPort=1102
jcs.auxiliary.RC.attributes.RemoveUponRemotePut=false
jcs.auxiliary.RC.attributes.GetTimeoutMillis=-1
jcs.auxiliary.RC.attributes.GetOnly=false
jcs.auxillary.RC.cacheeventlogger=org.apache.commons.jcs3.engine.logging.CacheEventLoggerDebugLogger
jcs.auxillary.RC.cacheeventlogger.attributes.logCategoryName=RCEventLogCategory

The remote server config is as follows-
# ################# REMOTE SERVER CONFIG  #####################
# Registry used to register and provide the IRmiCacheService service.
registry.host=localhost
registry.port=1101
# call back port to local caches.
jcs.remotecache.serverattributes.servicePort=1102
# cluster setting
jcs.remotecache.serverattributes.LocalClusterConsistency=true
jcs.remotecache.serverattributes.RemoveUponRemotePut=false
jcs.remotecache.cacheeventlogger=org.apache.commons.jcs3.engine.logging.CacheEventLoggerDebugLogger
jcs.remotecache.cacheeventlogger.attributes.logCategoryName=RCEventLogCategory

# #############################################################
# ################# DEFAULT CACHE REGION  #####################
# sets the default aux value for any non configured caches
jcs.default=
jcs.default.cacheattributes=org.apache.commons.jcs3.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=200000
jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs3.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=true
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.elementattributes=org.apache.commons.jcs3.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLife=7000
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true

jcs.region.cache1=
jcs.region.cache2=

Reply via email to