I\'m just starting to learn Camel and the first thing I see is
context.addRoutes(new RouteBuilder() {
public void configure() {
from(
In addition to other wonderful answers it should be mentioned that if you really need to create such RouteBuilder objects very often, you can create a helper method like this:
public static RouteBuilder fromConfigurator(Consumer configurator) {
return new RouteBuilder() {
public void configure() {
configurator.accept(this);
}
}
}
And use it like this:
context.addRoutes(fromConfigurator(
rb->rb.from("file:data/inbox?noop=true").to("file:data/outbox")));