Book Image

Mastering Apache Camel

By : Bilgin Ismet Ibryam, Jean Baptiste Onofre, Jean-Baptiste Onofré
Book Image

Mastering Apache Camel

By: Bilgin Ismet Ibryam, Jean Baptiste Onofre, Jean-Baptiste Onofré

Overview of this book

Table of Contents (15 chapters)
Mastering Apache Camel
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 Exception;

PollingConsumer...