1 Reply Latest reply on Jun 26, 2013 1:02 PM by Erik Pearson

    Exposing EmbeddedCacheManager through HotRod

    Erik Pearson Newbie

      One of the features of Infinispan 5.3 is to allow interaction with a cache manager both embedded and remotely.  However, in 5.3.0CR2 I only see mention of starting a HotRodServer is through the server start scripts.  After a little digging, I came up with the procedure to start an EmbeddedCacheManager, then pass it a HotRodServer like this:



      DefaultCacheManager cacheManager = new DefaultCacheManager(cacheConfigFile);

      ProtocolServerConfiguration serverConfig = new HotRodServerConfigurationBuilder().host(host).port(port).build();

      ProtocolServer server = new HotRodServer();

      server.start(serverConfig, cacheManager);



      This seems to work, however I am noticing that explicitly named caches in the EmbeddedCacheManager are intermittently not being exposed through RemoteCacheManagers connecting to the HotRodServer.  Is this the recommended way to expose a local cachemanager remotely so that they are accessible both as an EmbeddedCacheManager and remotely through a RemoteCacheManager?  Can additional documentation be added regarding this?


      Thanks for the great work!

        • 1. Re: Exposing EmbeddedCacheManager through HotRod
          Erik Pearson Newbie

          I resolved the issue with intermittently getting null caches returned.  it turned out to be a peculiarity with my testing environment (I was running two clustered embedded cache managers with the same cache config but different cache configs in the same JVM.  However, I'm still wondering if there's additional documentation about exposing an EmbeddedCacheManager through HotRod or other client/server protocol.