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

Luca Burgazzoli updated CAMEL-10845:
------------------------------------
    Description: 
One of the things that was missing in previous Java 8 DSL improvement rounds 
was the possibility to use Suppliers to provides objects to the routes.

As today:

{code:java}
    from("direct:start")
        .idempotentConsumer()
            .header("messageId")
            .messageIdRepository(createRepo())
        .to("mock:result");
{code}

With suppliers:

{code:java}
    from("direct:start")
        .idempotentConsumer()
            .header("messageId")
            .messageIdRepository(this::createRepo)
        .to("mock:result");
{code}

Adding that does not result in such a big improvement for the DSL but it adds 
some overhead to the underlying definitions as we may need to add additional 
variables to hold the suppliers and other stuffs to convert suppliers i.e. to 
expression clause so we should have a look at this issue in Camel 3.0 (where we 
may have the chance to do a deeper refactor and suppliers may play better).


  was:

https://lists.apache.org/thread.html/2fa89aab2e057fbdd5c2cac38eed7b12bec292e1fcb70f2ee20cfaf4@%3Cdev.camel.apache.org%3E


> Java 8 DSL : add support for Suppliers
> --------------------------------------
>
>                 Key: CAMEL-10845
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10845
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> One of the things that was missing in previous Java 8 DSL improvement rounds 
> was the possibility to use Suppliers to provides objects to the routes.
> As today:
> {code:java}
>     from("direct:start")
>         .idempotentConsumer()
>             .header("messageId")
>             .messageIdRepository(createRepo())
>         .to("mock:result");
> {code}
> With suppliers:
> {code:java}
>     from("direct:start")
>         .idempotentConsumer()
>             .header("messageId")
>             .messageIdRepository(this::createRepo)
>         .to("mock:result");
> {code}
> Adding that does not result in such a big improvement for the DSL but it adds 
> some overhead to the underlying definitions as we may need to add additional 
> variables to hold the suppliers and other stuffs to convert suppliers i.e. to 
> expression clause so we should have a look at this issue in Camel 3.0 (where 
> we may have the chance to do a deeper refactor and suppliers may play better).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to