1 Reply Latest reply on Jun 15, 2015 6:14 AM by Jimmy USU

    Hotrod client cannot access a distributed cache by name

    Jimmy USU Newbie

      I am a newbie to infinispan (7.2.1 final) and learning by experimenting. I need some help after I failed trying to access a remote cache by name. Here is the my scenario of infinispan in client-server mode.

      1) I started node1 in infinispan cluster and set the default remote cache name to node1_cache.

      ./clustered.sh -Djava.net.preferIPv4Stack=true -c clustered-node-1.xml -Djboss.node.name=Node1

      --Hotrod Server started

      2) Started node2 in infinispan cluster and set the default remote cache name to node2_cache.

      ./clustered.sh -Djava.net.preferIPv4Stack=true -c clustered-node-2.xml -Djboss.node.name=Node2

      --Hotrod Server started

      Now in from the Hotrod client I can see the RemoteCacheManager can initialize properly and also the cluster is being setup properly and nodes are getting added to each other in the console.

      But the problem is from one single hotrod client

      1) When I am trying to get the RemoteCache using the name node1_cache, I am getting the instance. I can access by name.

      2) But when I try to access the node2_cache by name which is defined in clustered-node-2.xml , the RemoteCache instance returning from remotecachemanager is null .

      RemoteCache<Object, Object> remoteCache = remoteCacheManager.getCache("node1_cache", false);  //Works fine.

      RemoteCache<Object, Object> remoteCache = remoteCacheManager.getCache("node2_cache", false);  //remoteCache == null here.

       

      Now Am I correct in accessing such way or am I missing anything in this ?

      Is it not that a single client can access all the configured caches of all the node configured in the same cluster ?

      I have attached both the configuration for hotrod servers.

      Please guide me. Thank you.