How to Empty Cache memoryIdempotentRepository in Apache Camel (DSL Java)

In this article, we provide a brief tutorial on how to clear the cache memoryIdempotentRepository in an Apache Camel Application.

The Enterprise Integration Pattern (EIP)  IdempotentConsumer implemented by Apache Camel filters out duplicate exchange messages. This process requires cache. Camel implements different kinds of cache, such as the MemoryIdempotentRepository [1]. 

Open Source Integration With Apache Camel and How Fuse IDE Can Help

Take any integration project and you have multiple applications talking over multiple transports on multiple platforms. As you can imagine, in large enterprises, applications like this can get complex very fast. Much of the complexity stems from two issues:

  1. Dealing with the specifics of applications and transports
  2. Coming up with good solutions to integration problems

Making your applications speak transports and APIs is relatively easy on its own. I'm sure everyone knows how to send JMS messages to their broker of choice; though it still requires in-depth knowledge of the JMS specification, which many developers may not have. On top of that, what happens when you want to route that JMS message to another application? You then have to take care of mapping the JMS message to the application plus handle any new concepts related to the application. Add a dozen other applications into the mix and you've got quite a headache on your hands.