camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Aggregate, completion, notifybuilder
Date Fri, 13 Jan 2017 11:21:55 GMT
And there is also message history eip
http://camel.apache.org/message-history.html

On Fri, Jan 13, 2017 at 12:20 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> An exchange has a timestamp when it was created as a property you can read
>
> On Fri, Jan 13, 2017 at 11:44 AM, sa_james <sa_reminder@hotmail.com> wrote:
>> Why does this one match?
>>
>>
>>
>>    this.context.addRoutes(new RouteBuilder() {
>>             @Override
>>             public void configure() throws Exception {
>>                 onCompletion().log("${body} completed");
>>                 from("direct:S")
>>                 .aggregate(new
>> GroupedExchangeAggregationStrategy()).constant(Boolean.TRUE).completionSize(2).completionTimeout(2000)
>>                 .split(body())
>>                 .aggregate(new
>> GroupedExchangeAggregationStrategy()).constant(Boolean.TRUE).completionSize(2).completionTimeout(2000)
>>
>>                 .to("log:icu")
>>
>>                 .to("mock:me").routeId("TEST");
>>             }
>>         });
>>         MockEndpoint mock = getMockEndpoint("mock:me");
>>         mock.expectedMessageCount(2);
>>
>>         NotifyBuilder notify = new
>> NotifyBuilder(this.context).fromRoute("TEST").whenDone(16).create();
>>         this.startCamelContext();
>>
>>         template.sendBody("direct:S", "A");
>>         template.sendBody("direct:S", "B");
>>         template.sendBody("direct:S", "C");
>>         template.sendBody("direct:S", "D");
>>
>>         boolean matches = notify.matches(20, TimeUnit.HOURS);
>>         assertTrue(matches);
>>
>> What is the best way to time how long it took for "mock:me" to receive its 2
>> messages?
>>
>>      NotifyBuilder notify = new
>> NotifyBuilder(this.context).wereSentTo("log:icu").whenCompleted(2).create();
>>      NotifyBuilder notify = new
>> NotifyBuilder(this.context).wereSentTo("mock:me").whenCompleted(2).create();
>>
>>
>>
>>
>> -----
>> Guile Newbie
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Aggregate-completion-notifybuilder-tp5792441p5792494.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message