Hi, We are using JCS remote cache server in a production environment. I'm sure many of you have remote cache servers too.
Question- How do you configure a test/dev environment? ..such that test instances of JBoss/tomcat/standalone apps do not access your remote caching server used for production? I'd like to configure JCS to work "offline" when it's in a test environment - i.e. instead of accessing the remote cache server just store/retrieve stuff from local memory. Basically what I'm looking for is a way to configure a "dummy" auxiliary cache in my test environment. This is my ccf: ---------------------------------------- # # Default settings, specifying a local in-memory cache of max size 0 objects # to effectively prevent objects being stored in regions which are not configured explicitly. # # These settings will be inherited by any regions which do not provide their own settings # to override these settings, thus unconfigured regions will not store any objects. # jcs.default= jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes jcs.default.cacheattributes.MaxObjects=0 jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache jcs.default.cacheattributes.UseMemoryShrinker=false jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes jcs.default.elementattributes.IsEternal=false jcs.default.elementattributes.IsLateral=false jcs.default.elementattributes.IsRemote=false jcs.default.elementattributes.IsSpool=false # # Settings configuring an auxiliary cache located on a remote caching server. # (auxiliary as in addition to the built-in local memory cache) # jcs.auxiliary.remotecache=org.apache.jcs.auxiliary.remote.RemoteCacheFactory jcs.auxiliary.remotecache.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes jcs.auxiliary.remotecache.attributes.FailoverServers=x.x.x.x:1102 jcs.auxiliary.remotecache.attributes.GetOnly=false jcs.auxiliary.remotecache.attributes.Receive=true jcs.auxiliary.remotecache.attributes.RemoveUponRemotePut=true jcs.auxiliary.remotecache.attributes.RmiSocketFactoryTimeoutMillis=15000 # # Settings specifying a cache region of unlimited size on a remote cache server, # where objects stay in remote server memory permanently and are never evicted. # # Note that being a region on a remote cache server, the configuration file on the remote server will # actually take effect, but duplicating the same settings client-side is recommended. See JavaDoc # note on this in class JCSCacheConfigurationFileTemplate. # jcs.region.region1=remotecache jcs.region.region1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes jcs.region.region1.cacheattributes.MaxObjects=2147483647 jcs.region.region1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache jcs.region.region1.cacheattributes.UseMemoryShrinker=false jcs.region.region1.elementattributes=org.apache.jcs.engine.ElementAttributes jcs.region.region1.elementattributes.MaxLifeSeconds=-1 jcs.region.region1.elementattributes.IsEternal=true jcs.region.region1.elementattributes.IsLateral=false jcs.region.region1.elementattributes.IsRemote=true jcs.region.region1.elementattributes.IsSpool=false jcs.region.region2=remotecache jcs.region.region2.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes ... and so on, same as region1 ---------------------------------------- We construct the ccf file programmatically and give it to JCS as a properties object. The auxiliaries are configured from static ccf file snippets. The regions are configured dynamically based on approx 6 static template ccf snippets (we just inset the new region name into the template). Normally there are perhaps 30 regions depending on the number of "cacheable objects" the host application uses. All of the regions point to the "remotecache" auxiliary since that's where their template ccf snippets point to. Is it possible to just change the configuration of the remotecache auxiliary to make it work offline? Since all regions effectively "point" to the remotecache auxiliary, it would be useful to be able to swap the configuration of that auxiliary with an offline dummy version of it, when it's running in a test environment, and then the configuration of everything else would remain the same. Is something like the following possible... jcs.auxiliary.remotecache=org.apache.jcs.memory.LRUMemoryCacheFactory I don't see a class called LRUMemoryCacheFactory in the project. Is there anything like that? I guess I could just omit the IP address of the remote cache server from the cff when running in a test environment. Are there any implications to doing that? I'd like the test environment to remain as similar to the production environment as possible. Any pointers would be appreciated Niall