Integration / Apache Camel Interview Questions
What is the Camel architecture — CamelContext, Routes, Endpoints, Components, and Processors?
The Camel architecture has five cooperating building blocks:
- CamelContext: Runtime container owning all routes, components, endpoints, type converters, and thread pools.
- Route: A directed pipeline from(uri) through EIPs/Processors to to(uri). Each route has a unique ID.
- Endpoint: A named channel identified by URI. Acts as consumer in from() or producer in to().
- Component: Factory creating Endpoints for a URI scheme. FileComponent handles all file: URIs; auto-discovered via META-INF/services.
- Processor: Any object implementing org.apache.camel.Processor that mutates an Exchange. All EIP constructs compile to chained Processors.
CamelContext ctx = new DefaultCamelContext();
ctx.addRoutes(new RouteBuilder() {
public void configure() {
from("timer:tick?period=5000")
.process(e -> e.getMessage().setBody("ping"))
.to("log:output");
}
});
ctx.start();
What role does a Camel Component play in the architecture?
Which Java interface must you implement to write a custom Camel Processor?
More Related questions...