Reputation: 23
I want to know what is Route-builders in Apache camel? And why is it used for? I have a project where JMS and apache camel are used but i dont know what is routebuilder.
Upvotes: 0
Views: 5405
Reputation: 591
In advance: I am not 100% sure about the long answer, so please correct me if I am fundamentally wrong here!
Short: The basic definition given by the official apache camel docu states:
The RouteBuilder is a base class which is derived from to create routing rules using the DSL. Instances of RouteBuilder are then added to the CamelContext.
Long:
Routebuilder is an abstract class. When implementing your own route, you usually extend from that RouteBuilder class (as the citation above already stated).
As a consequence you must implement the method configure()
in which you implement the route (from()
/.to()
/.process()
etc.)
I am pretty sure it is possible to implement a route without extending RouteBuilder, but then you would have to rebuild the framework given by apache camel. The whole syntax (from()
/.to()
/.process()
etc.) for implementing routes is provided by extending Routebuilder class.
Apache Camel is a framework. In order to use the framework your "route class" must inherit from the base classes of the given framework. Otherwise you would not be able use the framework, which already offers a huge part of the implementation.
If Claus Ibsen answers your question, stick to his answer, he knows virtually everything about apache camel.
Upvotes: 1