You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2019/08/06 09:44:00 UTC
[jira] [Commented] (CAMEL-10845) Java 8 DSL : add support for
Suppliers
[ https://issues.apache.org/jira/browse/CAMEL-10845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16900825#comment-16900825 ]
Claus Ibsen commented on CAMEL-10845:
-------------------------------------
I am adding suppliers so the DSL is a bit more modern with java 8 style.
For expression / predicate we should take a 2nd look as that would be cool.
> 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, eip
> Reporter: Luca Burgazzoli
> Assignee: Claus Ibsen
> Priority: Major
> 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
(v7.6.14#76016)