Apache Commons logo

Commons JCS™

Remote Auxiliary Cache Configuration

The following properties apply to the Remote Cache plugin.

Remote Client Configuration Properties

Property Description Required Default Value
FailoverServers This is a comma separated list of remote servers to use. They should be specified in the host:port format. The first server in the list will be used as the primary server. If the connection is lost with the primary, the cache will try to connect to the next server in the list. If a connection is successfully established with a failover server, then the cache will attempt to restore the conenction with the primary server. Y n/a
LocalPort This is the port on which the client will receive callbacks from the remote server. If it is not specified, then some port in the default range used by RMI will be the callback port. N default RMI port range
RemoveUponRemotePut If you configure the cache to remove upon a remote put, this means that the client will translate updates into removes. The client will remove any local copy it has of the object rather than storing the new version. If you have sticky load balancing across your client servers, then it would make sense to set RemoveUponRemotePut to true if the data is mostly client specific. If the data is re-usable, the you should most likely set this option to false, which is the default. N true
RmiSocketFactoryTimeoutMillis If this is greater than 0, then a custom socket factory will be installed in the VM. It will then use this timeout for all RMI communication. N 5000
GetOnly GetOnly is somewhat misnamed. If it is set to true, then the client will not send updates or removes to the remote server. It can still receive updates and removes. N false
Receive By default Receive is set to true. This means that the remote client will receive updates and removes from the remote server. If you set Receive to false, the remote client will not register a listener with the remote server. This means that the client can send update and remove requests to the server, and it can get from the server, but it will never receive notifications from the server. You might configure Receive to false if you just want to use the remote server as a data store. For instance, you may back the Remote Cache Server with the JDBC disk cache and set Receive=false when you have a high put and low read region. N true
ZombieQueueMaxSize The number of elements the zombie queue will hold. This queue is used to store events if we lose our connection with the server. N 1000

Example Configuration

					
# This remote client does not receive
jcs.auxiliary.RC=org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RC.attributes=org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RC.attributes.FailoverServers=localhost:1101,localhost:1102
jcs.auxiliary.RC.attributes.LocalPort=1201
jcs.auxiliary.RC.attributes.RemoveUponRemotePut=false
jcs.auxiliary.RC.attributes.RmiSocketFactoryTimeoutMillis=5000
jcs.auxiliary.RC.attributes.GetOnly=false
jcs.auxiliary.RC.attributes.Receive=false