On Fri, Aug 19, 2011 at 4:25 PM, Robert Dare <[email protected]> wrote: > Hi Everyone, > > I have not been able to find any documentation or examples on using the > "<choice>" elements with pojo based routing. > > I am using the Spring XML Extensions to define a route. I can not figure > out how to to test the body with a "<when>" structure. Using the "<xpath>" > element is obviously wrong since the message is a pojo and not > org.w3c.dom.Node. > > Is there any way to this with the Spring XML? > > I have tried adding Headers in my producer: > > producer.sendBodyAndHeader(body, "MyHeader", "SuperHeader"); > > ...but I have not been able to retrieve those headers in the XML route. >
You can use any of the scripting languages. http://camel.apache.org/languages.html However I suggest to start look at the built in language named Simple http://camel.apache.org/simple Then its a matter of <when> <simple>${header.MyHeader}} == 'SuperHeader'</simple> ... </when> Mind that you must have spaces around the == operator. In fact all the operators supported by Simple. > Thanks in advance, > > Rob > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
