5 Replies Latest reply on Jun 27, 2017 7:12 AM by Radim Vansa

    Infinispan  data load into Remote Cache multiple node concurrently

    abhishek dutta gupta Newbie

      I am trying to load data into Infinispan Multiple data node concurrently using RemoteCache. How can I achieve this into code?

      I am doing like this:

       

      final String host = "127.0.0.1";

            final int hotrodPort = 11222;

            final String cacheName = "";  // The name of the address book  cache, as defined in your server config.

       

            ConfigurationBuilder builder = new ConfigurationBuilder();

           /* builder.addServer()

                  .host(host)

                  .port(hotrodPort)

                  .marshaller(new ProtoStreamMarshaller());*/  // The Protobuf based marshaller is required for query capabilities

           

            builder.addServer().host("127.0.0.1").port(11222).socketTimeout(1200000).security().authentication().enable().serverName("myhotrodserver").

            saslMechanism("DIGEST-MD5").callbackHandler(new MyCallBackHandler("myuser", "ApplicationRealm", "qwer1234!".toCharArray())).marshaller(new ProtoStreamMarshaller());

            cacheManager = new RemoteCacheManager(builder.build());

       

            addressbookCache = cacheManager.getCache(cacheName);

            if (addressbookCache == null) {

               throw new RuntimeException("Cache '" + cacheName + "' not found. Please make sure the server is properly configured");

            }

       

            registerSchemasAndMarshallers();