Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 1.37 KB

File metadata and controls

16 lines (10 loc) · 1.37 KB

About

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.

How to run?

  1. mvn clean package
  2. mvn exec:exec
  3. cp input-message.xml input-dir/

UML Sequence Diagram

UML sequence diagram