oracle/coherence

Problem with configurating invocation service

Closed this issue · 3 comments

I would like to experiment with running an invocable on a cluster and added the following to the caching-schemes section of my custom cache configuration file:

<invocation-scheme>
      <scheme-name>my-invocation-service</scheme-name>
      <service-name>InvocationService</service-name>
      <autostart system-property="tangosol.coherence.invocation.autostart">true</autostart>
 </invocation-scheme>

but when I try running the code below I get the error message "No scheme found for service my-invocation-service"...

InvocationService service = (InvocationService)CacheFactory.getService
                ("my-invocation-service");

I can see from log output that Coherence is reading my cache configuration file but perhaps there is something more I need to configure in order for invocation to work or I have missread the doc on how to get hold of the service?!

Any suggestions on what I may be doing wrong is much appreciated as I right now cant see it....

fryp commented

Hello,

getService() takes a service name, not scheme name. The service name from the config snippet is "InvocationService"

Hi,

You specify the service name in the call to CacheFactory.getService();

Thanks both of you - that solved it - now my invocation works like a charm!