You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2019/04/01 09:56:00 UTC

[jira] [Updated] (CAMEL-13295) Add a helper method to easily add a route

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

Guillaume Nodet updated CAMEL-13295:
------------------------------------
    Description: 
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 simplify blocks such as
{code:java}
new RouteBuilder() {
    @Override
    public void configure() throws Exception {
        from(u).to("reactive-streams:" + uuid);
    }
}.addRoutesToCamelContext(context);
{code}
into
{code:java}
context.adapt(ModelCamelContext.class).addRoute(rb -> 
    rb.from(u).to("reactive-streams:" + uuid));
{code}

  was:
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}



> 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 simplify blocks such as
> {code:java}
> new RouteBuilder() {
>     @Override
>     public void configure() throws Exception {
>         from(u).to("reactive-streams:" + uuid);
>     }
> }.addRoutesToCamelContext(context);
> {code}
> into
> {code:java}
> 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)