Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Unknown
Description
Using the following method in `ModelCamelContext`
default void addRoute(ThrowingConsumer<RouteBuilder, Exception> rbc) throws Exception { addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { rbc.accept(this); } }); }
we can simplify blocks such as
new RouteBuilder() { @Override public void configure() throws Exception { from(u).to("reactive-streams:" + uuid); } }.addRoutesToCamelContext(context);
into
context.adapt(ModelCamelContext.class).addRoute(rb ->
rb.from(u).to("reactive-streams:" + uuid));