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:
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; andEndpoints
themselves couples them together and defeats some of the basic principles of SOA/ESB/EIP, etc.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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With