Re: Camel 2.19 - Java 8 DSL

2016-11-02 Thread Luca Burgazzoli
I've created this issue https://issues.apache.org/jira/browse/CAMEL-10438 I'll try to prototype some stuffs later this week --- Luca Burgazzoli On Wed, Nov 2, 2016 at 2:33 PM, Luca Burgazzoli wrote: > And with some love for the completion too: > > aggregate() > .correlation() > .body(St

Re: Camel 2.19 - Java 8 DSL

2016-11-02 Thread Luca Burgazzoli
And with some love for the completion too: aggregate() .correlation() .body(String.class, b -> b.substring(0, 3)) .strategy() .body(String.class, (existing, next) -> next + existing)) .completion() .body(String.class, b -> b.size() > 30) --- Luca Burgazzoli On Wed, Nov

Re: Camel 2.19 - Java 8 DSL

2016-11-02 Thread Luca Burgazzoli
Yep, "always()" was how my mind translated "constant(true)", do not know how it ended up in the mail :O What about: aggregate() .correlation() .body(String.class, b -> b.substring(0, 3)) .strategy() .body(String.class, (existing, next) -> next + existing)) .completionSize(3) -

Re: Camel 2.19 - Java 8 DSL

2016-11-02 Thread Claus Ibsen
On Tue, Nov 1, 2016 at 4:15 PM, Luca Burgazzoli wrote: > Something like: > > public void configure() throws Exception { > from("direct:start") > .aggregate() > .always() > .body(String.class, (existing, next) -> next + existing) > .completionSize(3)

Re: Camel 2.19 - Java 8 DSL

2016-11-01 Thread Luca Burgazzoli
Something like: public void configure() throws Exception { from("direct:start") .aggregate() .always() .body(String.class, (existing, next) -> next + existing) .completionSize(3) .to("mock:result"); } --- Luca Burgazzoli On Tue, Nov 1, 20

Re: Camel 2.19 - Java 8 DSL

2016-11-01 Thread Claus Ibsen
Hi Not yet, but maybe some of those POJO examples in the aggregator EIP. For example to supply a function as a lambda that is used for aggregation. For example how would it look like if it was just a basic function for String concat? For example this example public void configure() throws Except

Re: Camel 2.19 - Java 8 DSL

2016-11-01 Thread Luca Burgazzoli
Hi Claus, do you have any simple use case to be used as reference to prototype new Java 8 DSL extensions ? --- Luca Burgazzoli On Tue, Nov 1, 2016 at 12:09 PM, Claus Ibsen wrote: > Hi > > I would like to see if we could experiment with continue improving the > Java DSL for Java 8 to see if we

Camel 2.19 - Java 8 DSL

2016-11-01 Thread Claus Ibsen
Hi I would like to see if we could experiment with continue improving the Java DSL for Java 8 to see if we can make it more Java 8'ish for Content Enricher and Aggregator EIP. They require using the AggregationStrategy interface when you need to merge the 2 exchanges. And it has a POJO binding tha