The enterprise integration patterns are inspired by a book of the same name written by Gregor Hohpe and Bobby Woolf. The patterns described by these authors provide an excellent toolbox for developing enterprise integration projects. In addition to providing a common language for discussing integration architectures, many of the patterns can be implemented directly using FUSE Mediation Router's programming interfaces and XML configuration.
The FUSE Mediation Router product provides practical implementations for many of the patterns described in Hohpe and Woolf's book. FUSE Mediation Router applications are constructed from the following basic entities:
Routes—a route is a set of instructions for processing messages. Each route starts with a consumer endpoint (or source endpoint), which receives incoming messages, and ends with one or more producer endpoints (or destination endpoints), which send messages to external or local destinations. If the message exchange pattern is InOut, a reply message can also pass back through the route.
Many of the enterprise integration patterns can be mapped to routes that perform particular kinds of message processing. For example, most of the message routing and message transformation patterns from Hohpe and Woolf's book can be implemented as routes in FUSE Mediation Router.
Components—a component is an endpoint factory, where endpoints act as sources and sinks for messages in a route. Various component types can be used either to connect routes together or to communicate with the outside world. Frequently, a component represents a particular kind of transport protocol: for example, the JMS component, the FTP component, or the Mail component.
Some of the enterprise integration patterns are implemented using components. In particular, the JMS component and the ActiveMQ component are relevant to many of the patterns, because the original enterprise integration patterns are mainly concerned with messaging systems.
For a more detailed introduction to the basic concepts in FUSE Mediation Router, see Defining Routes in Java DSL.
To take a concrete example of an enterprise integration pattern, consider the splitter pattern, which can be implemented by a simple route in Java, as follows:
from("activemq:my.queue").splitter(xpath("/*")).to("file://some/directory")
Where the route is written in FUSE Mediation Router's Java DSL (see Basic Java DSL Syntax
for details). This route defines a consumer endpoint, activemq:my.queue
, using
the ActiveMQ component (where Apache ActiveMQ is a JMS -compliant messaging system). The
consumer endpoint is configured to receive messages from a queue called
my.queue
. Messages pulled off the queue pass through the splitter processor,
splitter(xpath("/*"))
, which applies an XPath expression to the incoming
message (presumed to be in XML format) in order to split it into multiple smaller messages.
In this example, the effect is to split off every root-level element into a separate
message.
You can also define an equivalent route using XML configuration:
<camelContext id="buildSplitter" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="activemq:my.queue"/> <splitter> <xpath>/*</xpath> <to uri="file://some/directory"/> </splitter> </route> </camelContext>
To gain a fuller understanding of how to implement enterprise integration patterns using FUSE Mediation Router, we recommend that you supplement this introductory guide by reading one or more of the following documents from the FUSE Mediation Router library:
FUSE Mediation Router Implementing Enterprise Integration Patterns.
FUSE Mediation Router Component Reference.
FUSE Mediation Router Programmer's Guide.