Apache Commons logo

Commons JCS™

Lateral TCP Auxiliary Cache Configuration

The following properties apply to the TCP Lateral Cache plugin.

TCP Configuration Properties

Property Description Required Default Value
TcpServers This is the list of servers this cache should try to connect to. With UDP discovery this is not necessary. N none
TcpListenerPort This is the port this cache should listen on. Y n/a
AllowGet Should this cache be allowed to get from other laterals. False means that it can only put, i.e. send updates and remove requests to other laterals. Lateral gets are not recommended for performance reasons. This used to be controlled by the attribute PutOnlyMode. N true
Receive Should this cache receive or only send to other laterals. You may want to set receive to false if you just need to broadcast to other caches. If you have a feed data parser, that doesn't need to receive updates, but you do want it to send invalidation messages, then you would set receive to false. If receive is false, the discovery service, if enabled, will only listen. N true
IssueRemoveOnPut If this is set to true, then the lateral client will send a remove command rather than a put command to any registered listeners. N false
FilterRemoveByHashCode If this is true, and IssueRemoveOnPut is true, the client will include the hashCode of the element to remove. If it is also true on the receiving end, the receiver will check to see if the element exists. If the element exists, and the hashCodes are the same, the item will not be removed. N false
SocketTimeOut This allows you to set the socket (read) timeout. N 1000
OpenTimeOut This allows you to set the socket open timeout. N 2000
UdpDiscoveryAddr The address the UDP discovery process should broadcast messages to. N 228.5.6.7
UdpDiscoveryPort The port the UDP discovery process should send messages to. N 6789
UdpDiscoveryEnabled Whether or not the UDP discovery service should be used to locate other lateral caches. 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

jcs.auxiliary.LTCP=org.apache.commons.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory
jcs.auxiliary.LTCP.attributes=org.apache.commons.jcs.auxiliary.lateral.socket.tcp.TCPLateralCacheAttributes
#jcs.auxiliary.LTCP.attributes.TcpServers=
jcs.auxiliary.LTCP.attributes.TcpListenerPort=1118
jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.8
jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
jcs.auxiliary.LTCP.attributes.Receive=true
jcs.auxiliary.LTCP.attributes.AllowGet=false
jcs.auxiliary.LTCP.attributes.IssueRemoveOnPut=false
jcs.auxiliary.LTCP.attributes.FilterRemoveByHashCode=false
jcs.auxiliary.LTCP.attributes.SocketTimeoOt=1001
jcs.auxiliary.LTCP.attributes.OpenTimeOut=2002
jcs.auxiliary.LTCP.attributes.ZombieQueueMaxSize=2000