Hi
What about .equals as in regular Java?
in.headers['a'].equals('aa')
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Vadim Chekan [mailto:[EMAIL PROTECTED]
Sent: 9. oktober 2008 07:42
To: [email protected]
Subject: Re: Choice operator
You are right. Groovy worked.
choice().when().groovy("request.headers.a == 'aa'").to("mock:true").
Having single char in "el" did not work either. Even "1==1" is false.
The only combination returning true in el is "true".
Vadim.
Claus Ibsen wrote:
> Hi
>
> Could you try with a different expression language, maybe the
> el("in.headers['a'] == 'aa'") is not working correctly. Last time it was also
> a problem with two digit letters.
>
> Can you try single letters such as:
> el("in.headers['a'] == 'a'")
>
>
> Med venlig hilsen
>
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
> -----Original Message-----
> From: Vadim Chekan [mailto:[EMAIL PROTECTED]
> Sent: 7. oktober 2008 22:50
> To: [email protected]
> Subject: Re: Choice operator
>
> I generate a message, set header 'a' to value 'aa' and than do a check
> "in.headers['a'] == 'aa'" and this check is false because message is
> routed to "mock:false" queue.
> I would expect it to go to "mock:true" destination.
>
> On Sun, Oct 5, 2008 at 11:47 PM, Claus Ibsen <[EMAIL PROTECTED]> wrote:
>> Hi Vadim
>>
>> Sorry I don't get it. Could you elaborate what you see and what is missing?
>>
>>
>> Med venlig hilsen
>>
>> Claus Ibsen
>> ......................................
>> Silverbullet
>> Skovsgårdsvænget 21
>> 8362 Hørning
>> Tlf. +45 2962 7576
>> Web: www.silverbullet.dk
>> -----Original Message-----
>> From: Vadim Chekan [mailto:[EMAIL PROTECTED]
>> Sent: 6. oktober 2008 08:41
>> To: [email protected]
>> Subject: Choice operator
>>
>> Folks,
>> Do you know what I'm missing here?
>>
>> from("timer://kickoff_5?period=10000").
>> setHeader("a").constant("aa").setBody().constant("bbb").
>> choice().when().el("in.headers['a'] == 'aa'").to("mock:true").
>> otherwise().to("mock:false");
>>
>>
>> I see in the trace that the message on the choise input has required
>> headers:
>>
>> 2008-10-06 06:37:04,418 [_5?period=10000] INFO TraceInterceptor
>> - ID-ubuntu/52774-1223275024293/2-0 -> choice1 Choice[ [When[
>> elExpression[in.headers['a'] == 'aa'] -> [To[mock:true]]]]
>> Otherwise[[To[mock:false]]]] InOnly
>> Properties:{org.apache.camel.timer.name=kickoff_5,
>> org.apache.camel.timer.firedTime=Mon Oct 06 06:37:04 GMT 2008,
>> org.apache.camel.timer.period=10000} Headers:{a=aa, firedTime=Mon Oct 06
>> 06:37:04 GMT 2008} BodyType:String Body:bbb
>>
>> Vadim.
>>
>
>
>