Search code examples
ignitegridgain

Submit ignite compute jobs to ignite grid from thick client


I started one ignite server node with peer class loading enabled and started another one in client mode and it connected to server node. I verified it by looking at topology snapshot. Next I tried to submit compute job from client to server node. That job kept running forever. But when I started 2nd node in server mode, compute job completed immediately.

Is it possible to submit compute jobs from thick client to ignite grid or I am missing some configuration? Ignite docs don't say anything about thick clients. I read about thin client in below link and found we need to enable compute jobs for thin client using 'maxActiveComputeTasksPerConnection' field. Is there any such setting for thick clients as well? https://ignite.apache.org/docs/latest/thin-clients/java-thin-client

All other settings are default.

Compute job :

ClusterGroup grp = ignite.cluster().forServers();
IgniteCompute ignieCompute = ignite.compute(grp);
igniteCompute.run(() ->  System.out.println("Task Executed"));

Solution

  • Sure, that's the major part of Apache Ignite - being able to spawn a new job. Here are more examples on the topic, note that API is the same regardless of whether clientMode is true or false. On the other hand, thin clients received the future just recently and have a slightly different API that's why Ignite has separate documentation about them I suppose.

    You don't need to adjust maxActiveComputeTasksPerConnection for thick clients/servers as well. If you feel that something is still not working as expected, please share a code snippet with your config somewhere.