Apache Camel: What marches messages along?
apache-camel, architecture, esb, java, soa
Solution
Under the hood I believe camel is constructing a pure graph where each node is a Camel endpoint/processor, and each edge is a route between two endpoints (a source and a destination). This graph is precisely what `RouteBuilder` is building when you invoke its API. When you go to `start()` a Camel route, the graph is most likely validated and translated into a series of `Runnable`s that need to be executed, and probably uses some kind of custom `Executor` or thread management to handle these `Runnable`s.
Thus, the execution of the `Runnable`s (processors processing messages as they arrive) are handled by this custom `Executor`. This is the mechanism that "marches messages along", although the order in which the tasks are queued up is driven by the overarching structure of the graph composed by `RouteBuilder`.
Problem
On an ESB like Apache Camel, what mechanism is actually "marching" (pulling/pushing) messages along the routes from endpoint to endpoint? Does the Camel `RouteBuilder` just compose a graph of `Endpoints` and `Routes` and know which destination/next `Endpoint` to pass a message to after it visits a certain `Endpoint` or do the `Endpoints` themselves know which is the next destination for the message it has processed. Either way, I'm confused: - If it is the `RouteBuilder` that knows the "flow" of messages through the system, then this `RouteBuilder` would need to know the business logic of when to `Endpoint A` should pass the message next to `Endpoint B` vs `Endpoint C`, but in all the Camel examples I see this business logic doesn't exist; and - It seems to be that putting that kind of "flow" business logic in the `Endpoints` themselves couples them together and defeats some of the basic principles of SOA/ESB/EIP, etc.