Thanks Claus, you've been very helpful

Claus Ibsen wrote:
On Sun, Sep 19, 2010 at 5:59 PM, Illtud Daniel
<illtud.dan...@llgc.org.uk> wrote:

Since the Content-Based Router EIP documents using <xpath>
for content-based routing swiching on header values, does
this mean you can only do this if the content is XML? Seems
odd to me to tie one thing (routing on header values) to
another unrelated property (XMLness of message). What if
you want to switch based on headers but are sending JSON or
text?

Yeah xpath works on the entire message expecting it to be in XML. You
know the world of XML used to be like "conquer the world".
So XML is up till your both ears.

I have no beef with XML, I find it very useful. But I
do think the documentation could do with an update. Maybe
put in an example of using <simple> to switch on a header
value if your message isn't XML. Ideally, the <xpath>
operator shouldn't be overloaded with the non-xpath
$header = 'value'. In my opinion it's confusing.

Looking at the documentation for simple, I've tried:

           <simple>${in.header.foo}=='yes'</simple>

But that *always* routes to test_out_true, regardless of the value
of the foo header.

You need spaces around the operators
          <simple>${in.header.foo} == 'yes'</simple>

If only everything in life was that easy to fix. Thanks Claus, I'll
try that today when I get a chance.

--
Illtud Daniel                                 illtud.dan...@llgc.org.uk
Prif Swyddog Technegol                          Chief Technical Officer
Llyfrgell Genedlaethol Cymru                  National Library of Wales

Reply via email to