You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Matt Raible <ma...@raibledesigns.com> on 2014/07/02 01:09:51 UTC
Choice DSL when checking for existence of a header
I'm trying to do the following with a the Java DSL in a route:
.choice()
.when(header("maxRows").isNotNull())
.recipientList(simple("sql:{{sql.claimLookupWithMaxRows}}")).delimiter("false")
.otherwise()
.recipientList(simple("sql:{{sql.claimLookup}}")).delimiter("false")
However, I get a compile error that "otherwise" is a method that doesn't exist.
Any ideas?
Thanks,
Matt
Re: Choice DSL when checking for existence of a header
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Check this FAQ
http://camel.apache.org/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html
On Wed, Jul 2, 2014 at 1:09 AM, Matt Raible <ma...@raibledesigns.com> wrote:
> I'm trying to do the following with a the Java DSL in a route:
>
> .choice()
> .when(header("maxRows").isNotNull())
> .recipientList(simple("sql:{{sql.claimLookupWithMaxRows}}")).delimiter("false")
> .otherwise()
> .recipientList(simple("sql:{{sql.claimLookup}}")).delimiter("false")
>
> However, I get a compile error that "otherwise" is a method that doesn't exist.
>
> Any ideas?
>
> Thanks,
>
> Matt
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/