LibraryLink ToToggle FramesPrintFeedback

Introduction to Spring Deployment

Figure 2.1 shows an overview of the architecture for a router deployed into a Spring container.


To instantiate a Spring container, FUSE Mediation Router provides the Spring wrapper class, org.apache.camel.spring.Main, which exposes methods for creating a Spring container. The wrapper class simplifies the procedure for creating a Spring container because it includes a lot of boilerplate code required for the router. For example, the wrapper class specifies a default location for the Spring configuration file and adds the Camel context schema to the Spring configuration, enabling you to specify routes using the camelContext XML element.

The Spring container is responsible for managing the lifecycle of RouteBuilder objects. In practice, this means that the router developer only defines the RouteBuilder classes. The Spring container finds and instantiates the RouteBuilder objects after it starts (see Spring Configuration).

The Spring configuration file is a key feature of the Spring container. Through the Spring configuration file you can instantiate and link together Java objects. You can also configure any Java object using the dependency injection feature.

In addition to these generic features of the Spring configuration file, FUSE Mediation Router defines an extension schema that enables you to define routing rules in XML.

In order to use certain transport protocols in your routes, you must configure the corresponding component and add it to the Camel context. You can add components to the Camel context by defining bean elements in the Spring configuration file (see Configuring components).