-
1. Re: Infinispan acessing data under cache.
pruivo Mar 11, 2013 6:22 AM (in response to varsha.g)Hi,
I'm assuming that the servlets are running in different machines/java virtual machine...
The cache needs to be configured as a clustered cache and to enable it, you need to set a transport in the global section to allow the machines/jvms communicate between them:
<config...>
<global>
<transport clusterName="infinispan-cluster"> <!-- you can set any name that you want -->
<properties>
<property name="configurationFile" value="jgroups-udp.xml"/>
</properties>
</transport>
</global>
<namedCache>
...
</namedCache>
</config>
The jgroups-udp.xml is already in the infinispan jar. It should work in most of the systems. If not, you have to set a new JGroups configuration. Check the JGroups' manual here: http://jgroups.org/manual-3.x/html/index.html
In addition to a transport you need to set how the data is keep. You can set a replicated mode (the data is replicated in all the machines) or distributed mode (the data is replicated in a subset of machines, 1 or more). In distributed mode, if the cache in a node does not have the data, it will fetch it.
<namedCache>
...
<clustering mode="r"> <!-- set mode to "d" for distribution -->
...
</clustering>
</namedCache>
This is an overview. The full documentation can be found here: http://docs.jboss.org/infinispan/5.2/configdocs/
If you have more question, post here in the forum. I was not clear let me know.
Cheers,
Pedro
-
2. Re: Infinispan acessing data under cache.
varsha.g Mar 12, 2013 2:01 AM (in response to pruivo)Thanks Pedro.Your answer helped me lot.