[ 
https://issues.apache.org/jira/browse/CAMEL-13295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guillaume Nodet resolved CAMEL-13295.
-------------------------------------
    Resolution: Fixed

https://github.com/apache/camel/commit/fea5d6831ab86781fe42e625fc7b3942089f2894

> Add a helper method to easily add a route
> -----------------------------------------
>
>                 Key: CAMEL-13295
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13295
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 3.0.0-M2
>
>
> Using the following method in `ModelCamelContext`
> {code:java}
> default void addRoute(ThrowingConsumer<RouteBuilder, Exception> rbc) throws 
> Exception {
>     addRoutes(new RouteBuilder() {
>         @Override
>         public void configure() throws Exception {
>             rbc.accept(this);
>         }
>     });
> }
> {code}
> we can simply blocks such as
> {code}
> new RouteBuilder() {
>     @Override
>     public void configure() throws Exception {
>         from(u).to("reactive-streams:" + uuid);
>     }
> }.addRoutesToCamelContext(context);
> {code}
> into
> {code}
> context.adapt(ModelCamelContext.class).addRoute(rb -> 
>     rb.from(u).to("reactive-streams:" + uuid));
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to