oracle / coherence

Oracle Coherence Community Edition
https://coherence.community
Universal Permissive License v1.0
427 stars 70 forks source link

Problem with configurating invocation service #122

Closed javafanboy closed 4 months ago

javafanboy commented 4 months ago

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 4 months ago

Hello,

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

mgamanho commented 4 months ago

Hi,

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

javafanboy commented 4 months ago

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