There is already running Ignite cluster on remote hosts. default-config.xml
contains:
- peerClassLoadingEnabled=true
- TcpDiscoveryVmIpFinder.addresses contains list of all host IPs

I am going to create the tool which performs tasks on remote hosts.
Is the code below right way to perform such communication:

Ignition.setClientMode(true);
Ignite ignite = Ignition.start();
IgniteCompute compute = ignite.compute(ignite.cluster().forRemotes());

compute.broadcast(
 () -> {
   System.out.println("info request from client");
   final String currentDirOnRemoteHost = new File("./").getAbsolutePath();
   Ignite ignite1 = Ignition.ignite();
   ignite1.compute(ignite1.cluster().forClients()).broadcast(
      () -> {
         //sending a response to client
         System.out.println("info response: currentDirOnRemoteHost=" +
currentDirOnRemoteHost);
      }
   );
});




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Client-Server-communication-tp2788.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to