I think you need to end the inner split with a .end() call. When you split the route you replace the current body with one of the split bodies and they get executed individually. If you want to do something after that split is processed, you have to end the split and then restore the exchange body that you are processing. Put a tracer on the route and study the tracer output carefully.
*Robert Simmons Jr. MSc. - Lead Java Architect @ EA* *Author of: Hardcore Java (2003) and Maintainable Java (2012)* *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39 <http://www.linkedin.com/pub/robert-simmons/40/852/a39>* On Fri, Nov 8, 2013 at 2:56 AM, sumitshining <sumitshin...@gmail.com> wrote: > I have created some routes. Following is the code which is having issues. > Following is the expected behavior: > > Exchange at first gets processed at hourlyFeedParts queue and then passed > to > dailyProcessor. > In dailyProcessor a property currHour is being checked if it is 23 or not. > If not, it just passes on. > If currHour == 23, code inside it shall be processed. This part again has > following functionality, > > If property feedsleft is not zero, all code inside the choice currHour==23 > is executed. This is fine. > if property feedsLeft is zero, code inside it processed. Code within looks > for any further messages. If yes, they are send to hourlyFeedParts. Here > comes the issue: If there is any message to be processed the code beyond > to("direct:hourlyFeedParts") is not executed. Though, if nothing is > returned, the code works fine. > I guess the issue could be code ends at to. So, what shall be the > alternative? > > from("direct:dailyProcessor") > .choice() > .when(simple("${property.currHour} == 23")) > .choice() > .when(simple("${property.feedsLeft} == 0")) > .split(beanExpression(APNProcessor.class, "recheckFeeds")) > .to("direct:hourlyFeedParts") > .endChoice() > .end() > .split(beanExpression(new S3FileKeyProcessorFactory(), "setAPNS3Header")) > .parallelProcessing() > .id("APN Daily PreProcessor / S3 key generator ") > .log("Uploading file ${file:name}") > .to("{{apn.destination}}") > .id("APN Daily S3 > uploader") > .log("Uploaded file ${file:name} to S3") > .endChoice() > .end() > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5742807.html > Sent from the Camel - Users mailing list archive at Nabble.com. >