-
1. Re: Programmatic replicated cache
vdzhuvinov Nov 16, 2016 4:13 AM (in response to stephan.zaulig)You may need to declare a transport method (for the underlying JGroups lib) which should suit the network where you have your Infinispan nodes deployed.
With XML it's done like this, by pointing Infinispan to a suitable JGroups config file, here for UDP:
<jgroups>
<stack-file name="jgroups-config" path="default-configs/default-jgroups-udp.xml"/>
</jgroups> -
2. Re: Programmatic replicated cache
stephan.zaulig Nov 17, 2016 3:43 AM (in response to vdzhuvinov)As a cache that is configured in domain.xml works, I think JGroups is configured correctly.
Also the session replication works via UPD protocol.
Here is the relevant configuration from domain.xml:
<subsystem xmlns="urn:jboss:domain:jgroups:4.0">
<channels default="ee">
<channel name="ee" stack="udp"/>
</channels>
<stacks>
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="UFC"/>
<protocol type="MFC"/>
<protocol type="FRAG2"/>
</stack>
As I understand it, if there is no default stack, the udp stack from "ee" chanel is used.
-
3. Re: Programmatic replicated cache
sebastian.laskawiec Nov 24, 2016 2:21 PM (in response to stephan.zaulig)One possible reason this doesn't work is that only one node knows about newly created cache. The configuration change is done by you programatically and it's not propagated to the rest of the servers.
The only way this might work (I'm not entirely sure but it won't hurt to try it out) is to deploy the app on all servers in the domain. This way the configuration should be in sync and replication should work. However you might get into troubles when undeploying/redeploying your app.
In Hot Rod Server we implemented our own version of ispn-cli.sh script which allows to create caches on the fly. It's much better solution but it would require having a separate cluster only for Infinispan. This would be a suggested solution.