camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject error handling design pattern advice
Date Thu, 05 Dec 2013 11:33:35 GMT
Hi All,

I've got a question about error handling. Here is my scenario...

I have a route which calls a bean..


Where my service bean looks like this...

	public void login(Exchange exchange) {
		SharedModel model = new SharedModel();

	public void createSimpleProduct(Exchange exchange) {
		ImportPayloadEntity importPayloadEntity =
		Collection<ItemEntity> itemEntities = importPayloadEntity.getItems();
                for (ItemEntity item : itemEntities) {        	
                      SharedModel model = ((SharedModel)
                      call soap call for each item in loop and use
attributes from SharedModel in calls

So what happens currently is that when there is an error in create simple
product, because the model is being used as the message, the route will fail
(after unsuccessful retries) when it comes across the first bad item.

I have been wondering how could I change this so that it sidelines only the
bad item and keep going through the rest?

I had some tries at changing my route to use a Splitter to split my route
into individual item messages (which might work nicely) but then I realized
that I would lose my sharedModel as the message body which i need that to
make the service calls. 

What is the best design pattern for this situation?

much appreciated

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

View raw message