Replicating Cache in Wildfly10
monarch7680 Jun 21, 2016 3:05 PMI'm trying to configure a replicating cache in Wildfly 10 (and ultimately EAP7). I'm attempting to do this using 2 separate instances of wildfly10 on the same machine. Here's what I have.
standalone-full-ha.xml files
In the infinispan subsytem configuration...
<cache-container name="newCache" default-cache="newCacheDefault" module="org.wildfly.clustering.ee.infinispan">
<transport lock-timeout="60000"/>
<replicated-cache name="newCacheDefault" statistics-enabled="true" mode="ASYNC" queue-flush-interval="1">
<file-store path="data/newCache" preload="true" purge="false"/>
</replicated-cache>
</cache-container>
In the jgroups subsystem config....
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="TCPPING">
<property name="initial_hosts">
<myip>[7800],<myip>[7700]
</property>
<property name="num_initial_members">
2
</property>
<property name="port_range">
0
</property>
<property name="timeout">
2000
</property>
</protocol>
<protocol type="MPING" socket-binding="jgroups-mping"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
<protocol type="FD"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="MFC"/>
<protocol type="FRAG2"/>
</stack>
In the web.xml I have
<resource-env-ref>
<resource-env-ref-name>cache/newCache</resource-env-ref-name>
<resource-env-ref-type>org.infinispan.manager.EmbeddedCacheManager</resource-env-ref-type>
<lookup-name>java:jboss/infinispan/container/newCache</lookup-name>
</resource-env-ref>
The class where I inject the cache...
@Resource(lookup = "java:jboss/infinispan/container/newCache")
private CacheContainer cacheManager
From this I get a Cache object entity. I cannot this CacheManager to inject if I use the cache/newCache name in my class.
I've looked around at a few other posts (linked below) to try and get a direct cache injection working but haven't as of yet.
Wildfly-10.0.0.CR4 replicated-cache issue.
I always get a name not found exception...any particular special configuration items beyond what's provide here?
Also, the filestore does not get created at the data/newCache location...not sure why.
Using the injected CacheManager, I am able to get the cache, and insert items, but I can't get the cache to replicate to the other instance. No errors are showing in the logs...just no replication.
The configuration works perfectly in wildfly 8...but doesn't work in WF9, WF10 or EAP 7.
I'm sure this is a configuration issue...just haven't been able to uncover it.
Anyone enounter this? Any help would be appreciated.