Write routing condition in xml config file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Write routing condition in xml config file

mta38
Hi all,
Is someone can say me how to test a header exchange value in a xml config file.
For example, if the header TEST exists in my " IN "message and its value is 10, I want to do the following:

<route>
        <from uri="…"
        <choice>
                <when>
                        In.header.TEST==10
                        <to uri="…"/>
                </when>

                …
        </choice>

</route>
Any help are welcome,

Best regards

Mta38
Reply | Threaded
Open this post in threaded view
|

Re: Write routing condition in xml config file

mta38
I found the answer by myself
Seems (but i'm not sure ) that choice processor is not the right processor to use.
In fact, if we use <filter> instead like that :

<route>
<from uri="..." />

                        <filter>
                                <el>${in.headers['TEST '] == 10}</el>
                                <to uri="...." />
                        </filter>

...
</route>

the behaviour is right as expected .

Mta38


mta38 wrote
Hi all,
Is someone can say me how to test a header exchange value in a xml config file.
For example, if the header TEST exists in my " IN "message and its value is 10, I want to do the following:

<route>
        <from uri="…"
        <choice>
                <when>
                        In.header.TEST==10
                        <to uri="…"/>
                </when>

                …
        </choice>

</route>
Any help are welcome,

Best regards

Mta38