2 Replies Latest reply on Jun 1, 2017 11:34 AM by galder.zamarreno

    Access jdg remote cache on nodejs

    vineetludhani123

      I tried using the infinispan module from npm to access the dist cache configured on a server. When I try to connect to the server by using the port number and host ip, I am able to see the logs containing connected status. When I try to retrieve the stored data from cache on local machine it states that no data was found for that key.. but when I access the same from my Java client, I am able to retrieve the stored data. Any help would be appreciated.

        • 1. Re: Access jdg remote cache on nodejs
          galder.zamarreno

          Compatibility mode between Java and Node.js clients is not fully in place yet, but we're improving it as we speak. So, data that's put with a Node.js client can't be retrieved by Java client and viceversa.

          • 2. Re: Access jdg remote cache on nodejs
            galder.zamarreno

            I've created HRJS-41 that would add a compatibility marshaller that'd enable Node.js client to potentially read Strings that are formatted following same method as default Java Hot Rod client marshaller...

             

            However, there's a possible workaround here. You can configure the Java Hot Rod client to use a marshaller that produces UTF-8 String representations, in which case, the Node.js client would be able to read data fine.

             

            E.g.

             

            import org.infinispan.commons.marshall.StringMarshaller;

            import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;

            ...

             

            ConfigurationBuilder clientBuilder = ...

            clientBuilder.marshaller(new StringMarshaller(Charset.forName("UTF-8")));