You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2014/10/01 11:30:34 UTC

Re: Get the endpoint that timed out in TimeoutAwareAggregationStrategy

Hi

Yeah the index is the timed out index of the processor that failed.

What EIP are you using? recipient list / multicast / or something else?

We could maybe improved this a bit so Camel can based on the index,
lookup the processor and if that is for sending to an endpoint, eg to
, recipient list etc. then we could grab the endpoint url.



On Tue, Sep 30, 2014 at 8:25 PM, zzoozz <gr...@gmail.com> wrote:
> I am having a hard time finding out which endpoint timeout when using the
> TimeoutAwareAggregationStrategy; the timeout method callback is called. My
> requirement is to send a message to a status queue when a timeout occurs
> with the endpoint which timed out.
>
> The timeout method in TimeoutAwareAggregationStrategy takes in Exchange
> oldExchange, int index, int total, long timeout.
>
> I imagine that the index can be used to get the endpoint that timed out but
> I am not able to find out how to get it. Any help is appreciated. Thanks.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Get-the-endpoint-that-timed-out-in-TimeoutAwareAggregationStrategy-tp5757254.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Get the endpoint that timed out in TimeoutAwareAggregationStrategy

Posted by zzoozz <gr...@gmail.com>.
Thanks for the reply Claus.

I am using a request reply pattern/multicast with aggregation where camel
routes a message from one endpoint to many other endpoints; Camel
aggregates the replies back and sends them to the original sender. So
something like this:

from("jms:SENDER1.REQUEST.V01?exchangePattern=InOut&replyTo=queue:SENDER1.REPLY&preserveMessageQos=true")
.multicast(new GatherResponsesTimeot())

.to("jms:CONSUMER1.REQUEST?exchangePattern=InOut&replyTo=queue:CONSUMER1.REPLY&preserveMessageQos=true")

.to("jms:CONSUMER2.REQUEST?exchangePattern=InOut&replyTo=queue:CONSUMER2.REPLY&preserveMessageQos=true")
.end();

//this is simulating the destination adapter
from("jms:CONSUMER1.REQUEST").setBody(constant("Hello World1"));

The Aggregator looks like the following:

private class GatherResponsesTimeot implements
TimeoutAwareAggregationStrategy {
        public Exchange aggregate(Exchange oldExchange, Exchange
newExchange) {
           ......

            return oldExchange;
        }

        public void timeout(Exchange oldExchange, int index, int total,
                long timeout) {

            //How can I know that CONSUMER2 timed out?? My requirement is
to publish to a topic that CONSUMER 2 timed out.

        }
}

On Wed, Oct 1, 2014 at 5:31 AM, Claus Ibsen-2 [via Camel] <
ml-node+s465427n5757277h15@n5.nabble.com> wrote:

> Hi
>
> Yeah the index is the timed out index of the processor that failed.
>
> What EIP are you using? recipient list / multicast / or something else?
>
> We could maybe improved this a bit so Camel can based on the index,
> lookup the processor and if that is for sending to an endpoint, eg to
> , recipient list etc. then we could grab the endpoint url.
>
>
>
> On Tue, Sep 30, 2014 at 8:25 PM, zzoozz <[hidden email]
> <http://user/SendEmail.jtp?type=node&node=5757277&i=0>> wrote:
>
> > I am having a hard time finding out which endpoint timeout when using
> the
> > TimeoutAwareAggregationStrategy; the timeout method callback is called.
> My
> > requirement is to send a message to a status queue when a timeout occurs
> > with the endpoint which timed out.
> >
> > The timeout method in TimeoutAwareAggregationStrategy takes in Exchange
> > oldExchange, int index, int total, long timeout.
> >
> > I imagine that the index can be used to get the endpoint that timed out
> but
> > I am not able to find out how to get it. Any help is appreciated.
> Thanks.
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Get-the-endpoint-that-timed-out-in-TimeoutAwareAggregationStrategy-tp5757254.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: [hidden email]
> <http://user/SendEmail.jtp?type=node&node=5757277&i=1>
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Get-the-endpoint-that-timed-out-in-TimeoutAwareAggregationStrategy-tp5757254p5757277.html
>  To unsubscribe from Get the endpoint that timed out in
> TimeoutAwareAggregationStrategy, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5757254&code=Z3JlZW5hcHBsZTk4MUBnbWFpbC5jb218NTc1NzI1NHwtMjE4NzI1ODQw>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Get-the-endpoint-that-timed-out-in-TimeoutAwareAggregationStrategy-tp5757254p5757285.html
Sent from the Camel - Users mailing list archive at Nabble.com.