An example demonstrating the routing capabilities of the Smooks Camel Cartridge. In particular, the application implements the splitter pattern as documented in the Enterprise Integration Patterns book.
Apache Camel is configured in src/main/java/org/smooks/examples/camel/integration/ExampleRouteBuilder.java
to poll a directory for input-message.xml
. Once Camel reads the XML file, it prints the file contents and sends it to Smooks. <jb:bean ...>
in smooks-config.xml
creates a LogEvent
for each activity/event
XML element in the file. The nested <jb:value .../>
visitors bind the bean's properties to the element's attributes and text content. On binding a LogEvent
bean to an event
element, Smooks routes the bean to one of two direct channels, depending on the country code of the event. Camel consumes the LogEvent
from the direct channel and dispatches it to a JMS queue. Note that the JMS queue is mocked in order to keep the example simple to run.
mvn clean package
mvn exec:exec
cp input-message.xml input-dir/