Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Options

The Idempotent Consumer has the following options:

...

If you have running Camel in a clustered environment, a in memory idempotent repository doesn't work (see above). You can setup either a central database or use the idempotent consumer implementation based on the Hazelcast data grid. Hazelcast finds the nodes over multicast (which is default - configure Hazelcast for tcp-ip) and creates automatically a map based repository:

Code Block
java
java

  HazelcastIdempotentRepository idempotentRepo = new HazelcastIdempotentRepository("myrepo");

  from("direct:in").idempotentConsumer(header("messageId"), idempotentRepo).to("mock:out");

...

See this little tutorial, how setup such an idempotent repository on two cluster nodes using Apache Karaf.

Available as of Camel 2.13.0

Another option for using Idempotent Consumer in a clustered environment is Infinispan. Infinispan is a data grid with replication and distribution clustering support. For additional information see camel-infinispan.

Include Page
Using This Pattern
Using This Pattern