Endpoint
As we saw in the Component
interface, the main function of a Component
is to create an Endpoint
. This is the purpose of the createEndpoint()
method. This method returns an Endpoint
. You don't explicitly call this method. The Camel routing engine calls this method for you.
When, in a route definition, you use the following syntax:
from("my:options")
During route bootstrap, the Routing Engine is looking for the my component in the CamelContext
(loaded as explained before).
If the component is not found, we will have a no component found for scheme my message (wrapped in a CamelRuntimeException
).
If the component is found, the routing engine instantiates the endpoint using the createEndpoint()
method.
Let's take a look at the Endpoint
interface:
public interface Endpoint extends IsSingleton, Service { String getEndpointUri(); EndpointConfiguration getEndpointConfiguration(); Producer createProducer() throws Exception; Consumer createConsumer(Processor processor) throws...