jeudi 26 février 2015

Make Camel split options configurable using Java DSL

I have a splitter within my Camel route that looks like this...



from("direct:myRoute")
// Split each exchange into multiple sub-exchanges on the basis of MySplitter.class
// Configure the splitter to stop on exception that comes up during processing of each sub-exchange
// Configure the splitter to share unit of work with the main exchange that means processing of the entire Exchange is an atomic success/failure
.split().method(MySplitter.class).stopOnException().shareUnitOfWork()
//do something with each sub-exchange
.to("direct:processEachSubExchange")
.end();


What I'd like to do is I'd want to keep the stopOnException as configurable. Which means that I would like to enable/disable the feature of stopping when an exception comes up on demand with the help of an externalized property.


Is this possible using Java DSL?


Aucun commentaire:

Enregistrer un commentaire