This came up in a
recent thread & thought I'd mention it here for those not on the list. If you want to implement the
Splitter Pattern from the
Enterprise Integration Patterns using XPath then you can use the following line of Java code...
from("activemq:my.queue").
splitter(xpath("/invoice/lineItem")).
to("file://some/directory");
Pretty neat eh. Use any language you like for the
expression such as
XQuery,
SQL,
Groovy,
Ruby etc.
It sure beats
programming in XML :)
2 comments:
Would be fun without parentheses and semi-colons in Groovy, and with additional magic to avoid chaining all those method calls:
from "activemq:my.queue"
splitter xpath("/invoice/lineItem")
to "file://some/directory"
Definitely! :). We really should get around to doing a Groovy DSL for Camel...
Post a Comment