The early Open ESB Camel SE examples use a simple input message with an Apache Camel Enterprise Integration Patterns (EIPs) content-based-routing XPath expression.
I needed to work on a more realistic example involving messages with namespace qualified elements, so I updated the routing logic to pass a Map of namespaces to the XPathBuilder before configuring Fluent Builders Java DSL content-based-routing.
// Sets up a namespace-qualified XPath expression XPathBuilder orderPriceGT500 = new XPathBuilder("//po:OrderInfo/po:OrderPrice > 500"); Map nsm = new HashMap(); nsm.put("po", "http://www.globalcompany.com/ns/order"); orderPriceGT500.setNamespaces(nsm);
and:
// Routes based on expression evaluation
from(jbiInURI).choice().when(orderPriceGT500).to(jbiBpel2DbURI).
otherwise().to(jbiBpel2FileURI);
Category: camel se, open source, open-esb
posted by Mike Wright on: October 23, 2008