I have thrown together a quick example @ tristantarrant/infinispan-playground-distexec · GitHub
Basically it uses a "parameter" cache keyed by Address to pass a Map<String, ?> of parameters to each node.
What a gift! Thank you Tristan!
I will learn it today and let you know how it goes.
Have a good day!
I have tried integrating the example into WildFly server and tested with cluster setup: Apache proxy with two servers running in standalone-full-ha mode. I invoked a web service call to trigger the execution made in ParametrizedDistExec code. Let's say server A and B and when I call the web service call, Apache directs call to server A or B.
Two issues that bother me a lot:
1. When the web service is invoked (assume server A is called), JGroup can see two nodes in the cluster, while DefaultCacheManager.getClusterSize() only returns 1. If I keep hit the web service call several times, then server B in the cluster gets called and then DefaultCacheManager.getClusterSize() becomes 2. Server B is slave and will not do anything. If the web service call hits server A again, then example works since server A is the coordinator. My question is that is there anyway for DefaultCacheManager to know server A and B before both servers have to be hit by web service?
2. When server A is first invoked, it becomes coordinator in the cache manager. So when B is invoked, it is slave and will not do anything. I would like any server in the cluster can behave like coordinator, how could we do that?
Seems #2 can be resolved now if I use EmbeddedCacheManager instead of creating a cache manager myself. Don't know why ...
#1 remains and any help is appreciated!