1 Reply Latest reply on Mar 5, 2017 10:05 AM by Michal Karm Babacek

    Why are certain pre-configured and started caches not visible to Hot Rod client?

    Michal Karm Babacek Apprentice

      Hello there,

       

      I've been playing with Hot Rod Java client and I am bewildered as to the fact that the client apparently see only certain caches of the selected cache container. Naturally, I need the client to be able to work with any of my configured caches, both distributed and replicated. I will post here snippets of my configuration from the client and the server. If the answer is not obvious and requires deeper insight or debugging, I could prepare a Dockerized reproducer.

       

      Infinispan server 8.2.6.Final

      I have a one test node, with it I have one channel, one cluster, one cache container and four caches in that container. See the configuration, please.

       

      Hot Rod Java client

      This is what my minimized example trial does, modeled after the famous AddressBook quick start:

      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.addServer()
            .host(host)
            .port(hotrodPort)
            .marshaller(new ProtoStreamMarshaller());
      cacheManager = new RemoteCacheManager(builder.build());
      // I don't think this matters here...I have only 1 channel.
      cacheManager.switchToCluster("cluster");
      final String[] test  = {"default", "infinispan-rules", "same-as-default", "default-replicated"};
      RemoteCache<Object, Object> remoteCache;
      for (String cacheName : test) {
         remoteCache = cacheManager.getCache(cacheName);
         if(remoteCache == null) {
            System.out.printf("Cache %s is null.", cacheName);
         }
      }
      

      Regarding Protobuffers: As soon as I can look up my infinispan-rules cache, I would like to take advantage of Remote Query and play with it from within the Hot Rod client. So far I knew the Query only in the embedded scenario.

       

      Log, client side

      On the client side, default and same-as-default dist caches are found, whereas barebone default-replicated and heavily configured infinispan-rules are not found.

      This is the log from the client.

       

      Log, server side

      I guess the most pertinent is the DEBUG log from the server instance. It comprises boot and the client's run. See the Infinispan server log.

      All caches appear to be started, what is wrong with these replicated caches that they cannot be found? I understand the difference as far as distribution and replication of data goes, but I have no idea why would it be invalid for the cache to be operational in this example. Does it matter that the test server is a single one, i.e. nobody joins him and it is the sole singleton and coordinator in one instance? too many JOIN attempts (6): becoming singleton [log].

       

      Thanks for enlightening me. I did try the usual FAQ lookup and doc reading, but it appears that all examples on Hot Rod clients are using local caches and are very trivial.

       

      Cheers

      -K-