camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hilde <hilde.sch...@yahoo.de>
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)
   .end()
  .onCompletion().onWhen(simple("${header.status} == 0"))
	.bean(loadPayloads, "finalSuccess")
	.to("activemq:topic:" + JmsDestinations.TOPIC_DASHBOARD_AUDITLOG)
  .end()
...

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 http://camel.apache.org/oncompletion.html

cheers
Hilde



--
View this message in context: http://camel.465427.n5.nabble.com/onCompletion-with-onWhen-predicate-tp5717401.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message