Coherence Extend

Are you getting the following error when trying to use a Coherence Extend client?

java.lang.IllegalStateException : SafeCluster has been explicitly stopped or has not been started

You may want to disable the packet publisher on the client (override is tangosol.coherence.tcmp.enabled). To be extra sure, you could even set client’s TTL is set to 0 (which will prevent it from finding clusters on other computers), and if you run the cache server locally you may even want to give it a clusterport that no cluster members use. Why? Because even though Extend clients are supposed to communicate over TCP, in my experience they will try to discover clusters via multicast and, if found, attempt to join them via the usual UDP connection. Particularly when they are run on the same machine as the server.

Coherence “directed query not supported”

Oracle claims that the Coherence API is the same whether or not during runtime it is a full member of the grid or it is an Extend client:

Coherence*ExtendTM clients provide the same rich API support as the standard Coherence API without being full data members of the cluster.ref

While strictly speaking that is true, I am learning the API usage may differ. The latest example I have is the following code, which works fine when run inside (as a full member of) the grid:

InvocationService invocationService = getInvocationService();
Set members = invocationService.getCluster().getMemberSet();
Map<Member, CoherenceMember> memberResults = invocationService.query(  
    new MyCacheDistributionQueryInvocable(), members);

However, when run as an Extend client, this code gives an error that Google as yet can shed no light on:

java.lang.IllegalArgumentException : directed query not supported; the specified Member set must be null

So, the second parameter to InvocationService#query() has to be null, if run as an Extend client. So, the question is now: how do I get information about the individual members of the grid from the Extend client? Or is it even possible? This post may end up being helpful.