Figure 1.1 gives an overview of the architecture that forms the basis of FUSE Mediation Router applications.
The OSGi container provides the overall framework for your FUSE Mediation Router applications. To start the OSGi container, open a command prompt, change directory to the FUSE ESB install directory, and enter the following command:
bin/servicemix
After a few moments, the container initializes itself and you should see a shell prompt like the following:
ServiceMix>
For example, to list all of the bundles currently deployed in the OSGi container, enter
the command osgi list
.
All parts of the application, including the FUSE ESB kernel and the FUSE Mediation Router core, are deployed as OSGi bundles. In OSGi, everything is a bundle.
At its simplest, a bundle is simply a JAR file that has a few additional entries in its
manifest, META-INF/MANIFEST.MF
. These additional entries are known as
bundle headers (for more details, see Example 1.3).
The FUSE ESB NMR is a general-purpose message bus used for transmitting messages between bundles in the OSGi container. It is modelled on the Normalized Message Router (NMR) defined in the Java Business Integration (JBI) specification. Hence, the FUSE ESB NMR can be used to transmit XML messages, optionally augmented with properties and attachments. Unlike the standard NMR, however, the FUSE ESB NMR is not restricted to the JBI container. You can use the NMR to transmit messages inside the OSGi container or, if the JBI container is also deployed, to transmit messages between the two containers.
In Figure 1.1, the NMR is represented as a horizontal graphical element in order to emphasize its role linking together various application bundles. In practice, however, the NMR is deployed as a collection of bundles, just like any other application in the OSGi container.
The FUSE Mediation Router core provides the core functionality for implementing the Enterprise
Integration Patterns. This feature consists of the camel-core
bundle and a few
other basic bundles.
For your FUSE Mediation Router applications, you will always require the FUSE Mediation Router core and possibly one or more FUSE Mediation Router components as well.
The Spring dynamic modules for OSGi service platforms feature makes it relatively easy to use Spring configuration files in the context of OSGi. Spring dynamic modules extends the OSGi framework, so that Spring configuration files are automatically detected whenever you start an OSGi bundle.
When you start a bundle (for example, using the command, osgi start
), the
Spring dynamic bundles extensor automatically checks to see whether there are any Spring
configuration files matching *.xml
under the META-INF/spring
directory. If any configuration files are found there, Spring automatically instantiates and
initializes the beans defined in these files. By exploiting this mechanism, you can
effectively use Spring configuration files to bootstrap your application. This mechanism is
particularly convenient for FUSE Mediation Router, because it is normal practice to use Spring
configuration files to initialize FUSE Mediation Router applications.
A FUSE Mediation Router component is essentially an endpoint factory. Thus there are components for creating File endpoints, SEDA endpoints, HTTP endpoints, CXF endpoints, JMS endpoints, and so on. A few components are part of the FUSE Mediation Router core, but many more of them are packaged separately as OSGi bundles.
For a list of supported FUSE Mediation Router components, see Camel components.
The NMR component is of particular interest, because it enables FUSE Mediation Router applications to communicate with each other (and with other bundles) through the NMR. Additionally, the NMR makes it possible to communicate with applications deployed into the JBI container.
For details about how to use the NMR component, see Using the NMR Component.
FUSE Mediation Router applications are deployed as regular OSGi bundles. To bootstrap your
application, you normally define a Spring configuration file in the
META-INF/spring
directory. For detailed examples, see Deploying an XML Route and Using the NMR Component.
If a FUSE Mediation Router application needs to communicate over the NMR, it can create an NMR endpoint simply by specifying an NMR endpoint URI as the source or destination of a route. For details of how this is done, see Using the NMR Component.