I see that the latest MEAP of Camel In Action answers this question in
the first page of Appendix A.

On Tue, Aug 10, 2010 at 11:56 AM, Claus Ibsen <claus.ib...@gmail.com> wrote:
> On Tue, Aug 10, 2010 at 5:42 PM, Mark Webb <elihusma...@gmail.com> wrote:
>> I am setting up a route in XML and want to send messages to a
>> destination based on a field in the header.  I have the following:
>>
>> <log message="Analyzed [${body}] with destination --> ${header.dest}"/>
>>                <choice>
>>                        <when>
>>                                <header>'${header.dest}' = 'stuff'</header>
>>                                <to uri="jms:somewhere" />
>>                        </when>
>>                </choice>
>>
>> As I test this the log gives me the correct information for
>> ${header.dest} and that being "stuff", but I do not know how to test
>> the value in order to send the message to the proper location.  What
>> is the proper syntax here?  I looked through the Camel in Action book
>> and the camel website and cannot find anything.
>>
>
> The <header> will only grab a header. It's not a scripting language to
> evaluate expressions/predicates etc.
>
> For that you can use any of the more powerful languages
> http://camel.apache.org/languages.html
>
> For example you can use the built in simple language
> http://camel.apache.org/simple.html
>
> Which is being explained in the appendix A of the Camel book (avail in
> next MEAP update).
>
> <simple>${header.dest} == 'stuff'</simple>
>
>
>> Thanks,
>> Mark
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Reply via email to