camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject IdempotentRepository key removal within OnException
Date Mon, 25 Apr 2016 21:25:07 GMT

I have the below routes setup. 

The behaviour that I am noticing is that the key within the Idempotent
Repository is not being removed when an exception is thrown when using the
'seda' component in the OnException (on line stated below). 

If I change to use 'direct' instead of 'seda' within the OnException then
the key is correctly removed from the cache when the exception is thrown. 

I am using MemoryIdempotentRepository and the version of Apache Camel is

Can you please help me with my queries:

    1) why would the key not be removed from the repository cache when using
'seda' within the OnException?
    2) is there an issue with using 'seda' within the OnException?

Here is a snapshot of the routes:

In MyRouteClass1
 private IdempotentRepository<String> duplicatesRepo =
  .setHeader("subjectText", simple("failure email!"))

    .bean(someService, "findWorkItems")
      .bean(someService, "updateWorkItemToHandled")

    .idempotentConsumer(simple("${body.workItemId}"), duplicatesRepo)
    .bean(someService, "handleWorkItem")  // e.g. exception would be thrown
within here
    .setHeader("resultId", body())

In MyRouteClass2

  .setHeader("from", simple(""))
  .setHeader("to", simple(""))
  .setBody(simple("Failure:\n ${exception.message} \n\ndetail: \n${body}"))
  .log("Failure email now sent.")

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message