Invoking an entry processor from a CacheInterceptorAdapter

classic Classic list List threaded Threaded
2 messages Options
duke2 duke2
Reply | Threaded
Open this post in threaded view
|

Invoking an entry processor from a CacheInterceptorAdapter

 I am trying to reference a cache from within a CacheInterceptorAdapter (onAfterPut method) to invoke an entry processor to another cache after a put.

How to get a refrence to a cache?

I tried the followings:

               
Ignite ignite = Ignition.start("default-config.xml");
IgniteCache<Integer, Address> cache = ignite.getOrCreateCache("MyOtherCache");

or

IgniteCache<Integer, Address> cache = ignite.start().getOrCreateCache("MyOtherCache");

But it fails:


class org.apache.ignite.IgniteCheckedException: Ignite instance with this name has already been started: gridgain-cluster 
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: Invoking an entry processor from a CacheInterceptorAdapter

 This message means that you are trying to start two ignite instances in
the same JVM with the same
  igniteInstanceName in your configuration.


https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/IgniteConfiguration.html#setIgniteInstanceName-java.lang.String-

  Check your configuration file for this property.

On Thu, Jul 25, 2019 at 12:41 PM Jean-Philippe Laroche <[hidden email]> wrote:
 I am trying to reference a cache from within a CacheInterceptorAdapter (onAfterPut method) to invoke an entry processor to another cache after a put.

How to get a refrence to a cache?

I tried the followings:

               
Ignite ignite = Ignition.start("default-config.xml");
IgniteCache<Integer, Address> cache = ignite.getOrCreateCache("MyOtherCache");

or

IgniteCache<Integer, Address> cache = ignite.start().getOrCreateCache("MyOtherCache");

But it fails:


class org.apache.ignite.IgniteCheckedException: Ignite instance with this name has already been started: gridgain-cluster