We have two Ignite clusters. They work completely independent one from other. This is how it works now:
IgniteCluster1
String response1 = compute.execute(Task1.class, request1);
IgniteCluster2 works the same way
String response2 = compute.execute(Task2.class, request2);
But now Task1 from IgniteCluster1 should have response2 for calculations of response1. We do not want to have Cache2 in IgniteCluster1 for that. So we must somehow get response2 from IgniteCluster2. Also we don't want send /request to SpringBootApplication2 across network because of latency - we want ask data from IgniteCluster2 directly.
We see now only one solution - all remain the same, but in SpringBootApplication1 we also start up client node of IgniteCluster2. And in Task1 we firstly get response2 through this client node
String response2 = compute.execute(Task2.class, request);
and after that we get response1 through server node of IgniteCluster1
String response1 = compute.execute(Task1.class, request + response2);
1.2.3. This solution will definitely work. But quality of this way depends on your service design/architecture.
Optionally, after configure cache's node filter you can use ClusterGroup feature to compute task on nodes which contains nessesary cache's partitions. Like so:
Ignite ignite = Ignition.ignite();
IgniteCluster cluster = ignite.cluster();
ClusterGroup cacheGroup1 = cluster.forCacheNodes("myCache1");
ClusterGroup cacheGroup2 = cluster.forCacheNodes("myCache2");
// Request to type1 nodes
String response1 = ignite.compute(cacheGroup1).execute(Task1.class, request1);
// type2
String response2 = ignite.compute(cacheGroup2).execute(Task2.class, request2);
More details here https://www.gridgain.com/docs/latest/developers-guide/distributed-computing/cluster-groups