You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Murari Raghavan <mu...@gmail.com> on 2012/08/22 06:44:03 UTC

Cannot invoke Otherwise method due to the splitter

Hello:

Here is my route. The otherwise() call cannot be invoked because of the
splitter. Is there a way to bypass this issue? 

from(inboundroute)
.choice()
.when(header("CamelFileName").regex("^DDSBATCHSTATUS.*(xml)$"))
	.to(someroute)
	.split().method(DDSResponseSplitService.class, "splitStatusResponse")
	.process(new Processor() {
	public void process(Exchange exchange) throws Exception {
	// do something
	}
	})
	.to(outboundroute)
.otherwise() <-------- This is not working because of the splitter
	.to(archive);

Thanks,
Murari Raghavan



--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-invoke-Otherwise-method-due-to-the-splitter-tp5717811.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot invoke Otherwise method due to the splitter

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See this FAQ
http://camel.apache.org/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html

On Wed, Aug 22, 2012 at 6:44 AM, Murari Raghavan
<mu...@gmail.com> wrote:
> Hello:
>
> Here is my route. The otherwise() call cannot be invoked because of the
> splitter. Is there a way to bypass this issue?
>
> from(inboundroute)
> .choice()
> .when(header("CamelFileName").regex("^DDSBATCHSTATUS.*(xml)$"))
>         .to(someroute)
>         .split().method(DDSResponseSplitService.class, "splitStatusResponse")
>         .process(new Processor() {
>         public void process(Exchange exchange) throws Exception {
>         // do something
>         }
>         })
>         .to(outboundroute)
> .otherwise() <-------- This is not working because of the splitter
>         .to(archive);
>
> Thanks,
> Murari Raghavan
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Cannot-invoke-Otherwise-method-due-to-the-splitter-tp5717811.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen