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: ...

Get Mastering Apache Camel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.