Figure 3.1 gives an overview of the architecture of the router that features in this tutorial.
The simple router shown in Figure 3.1 consists of the following parts:
Router—the core component of the simple router. It consists of
an instance of type org.apache.camel.builder.RouteBuilder, which
defines a route between component endpoints. This route is executed at runtime by the
Camel engine.
Spring container—a standard container (see Spring) that implements sophisticated configuration mechanisms (for example, supporting concepts such as dependency injection and inversion of control).
Spring configuration file—by default, the Spring wrapper looks
for the Spring configuration files, matching META-INF/spring/*.xml,
on the current classpath.
In this example, the Spring container is configured with the name of a Java package,
tutorial. The Spring wrapper initializes any router artifacts (for
example, instances of RouteBuilder) that it finds in the
specified Java package.
File endpoints—the RouteBuilder instance
is responsible for routing messages between different endpoints. In this example, all of
the endpoints are file endpoints, which are used to read or write
messages to the file system.
The tutorial consists of the following stages: