camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hilde <>
Subject onCompletion with onWhen predicate
Date Wed, 15 Aug 2012 15:01:15 GMT
Hello folks!

I have figured out that onCompletion().onWhen() cannot be used multiple.

Actually onCompletion().onWhen() suggests to use it multiple erroneously. 
I wrote the following route:

from("seda:" + SedaDirectDestinations.SEDA_LOAD).routeId(ROUTE_ID)
   .onCompletion().onWhen(simple("${header.status} != 0"))
	.bean(loadPayloads, "finalFail")
	.to("activemq:topic:" + JmsDestinations.TOPIC_DASHBOARD_AUDITLOG)
  .onCompletion().onWhen(simple("${header.status} == 0"))
	.bean(loadPayloads, "finalSuccess")
	.to("activemq:topic:" + JmsDestinations.TOPIC_DASHBOARD_AUDITLOG)

But that doesn't work because the latter onCompletion().onWhen() overwrites
the first one.
onCompletion().onWhen() must not exist more than once.

Maybe you can publish that hint on


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

View raw message