You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Damien Nicolas <dm...@gmail.com> on 2019/07/26 12:46:46 UTC

A question about reply timeout

Hello,
I have multiple sequential queues in InOut pattern, each queue leads to one
processor.
If a processor takes too much time for a treatment, I would like that the
request-reply detects a timeout and send a timeout exception.
The timeout with "*CamelJmsRequestTimeout*" works but only for the first
queue.

Example:
If I have this:

q1 -> p1 -> q2 -> p2 ->  q3 -> p3

q1 *CamelJmsRequestTimeout *is for example 15". If each processor take 6",
I will have a timeout at p3.
I would like to have a reply to q1 after p1 and not after p3. And being
able to modulate the timeout after each processing.

This is an example code:

from("jms:queue:q1")
        .setExchangePattern(ExchangePattern.InOut)
        .setHeader("CamelJmsRequestTimeout", constant("15000"))
        .process("p1")
        .to("jms:queue:q2");

from("jms:queue:q2")
        .setExchangePattern(ExchangePattern.InOut)
        .setHeader("CamelJmsRequestTimeout", constant("5000"))
        .process("p2")
        .to("jms:queue:q3");

from("jms:queue:q3")
        .setExchangePattern(ExchangePattern.InOut)
        .setHeader("CamelJmsRequestTimeout", constant("5000"))
        .process("p3");

I tried to double the concurrentConsumers (so from 1 to 2) on each procuder
for the reply on the temp queue, but I still have this problem.

Is my design possible? If yes, which option should I use?

Thanks

Re: A question about reply timeout

Posted by Damien Nicolas <dm...@gmail.com>.
up

Le ven. 26 juil. 2019 à 16:08, Damien Nicolas <dm...@gmail.com> a
écrit :

> Hmmm actually, if I add a queue, it just move the problem. Any idea?
>
> Le ven. 26 juil. 2019 à 14:46, Damien Nicolas <dm...@gmail.com> a
> écrit :
>
>> Hello,
>> I have multiple sequential queues in InOut pattern, each queue leads to
>> one processor.
>> If a processor takes too much time for a treatment, I would like that the
>> request-reply detects a timeout and send a timeout exception.
>> The timeout with "*CamelJmsRequestTimeout*" works but only for the first
>> queue.
>>
>> Example:
>> If I have this:
>>
>> q1 -> p1 -> q2 -> p2 ->  q3 -> p3
>>
>> q1 *CamelJmsRequestTimeout *is for example 15". If each processor take
>> 6", I will have a timeout at p3.
>> I would like to have a reply to q1 after p1 and not after p3. And being
>> able to modulate the timeout after each processing.
>>
>> This is an example code:
>>
>> from("jms:queue:q1")
>>         .setExchangePattern(ExchangePattern.InOut)
>>         .setHeader("CamelJmsRequestTimeout", constant("15000"))
>>         .process("p1")
>>         .to("jms:queue:q2");
>>
>> from("jms:queue:q2")
>>         .setExchangePattern(ExchangePattern.InOut)
>>         .setHeader("CamelJmsRequestTimeout", constant("5000"))
>>         .process("p2")
>>         .to("jms:queue:q3");
>>
>> from("jms:queue:q3")
>>         .setExchangePattern(ExchangePattern.InOut)
>>         .setHeader("CamelJmsRequestTimeout", constant("5000"))
>>         .process("p3");
>>
>> I tried to double the concurrentConsumers (so from 1 to 2) on each
>> procuder for the reply on the temp queue, but I still have this problem.
>>
>> Is my design possible? If yes, which option should I use?
>>
>> Thanks
>>
>
>
> --
> Damien NICOLAS
>


-- 
Damien NICOLAS

Re: A question about reply timeout

Posted by Damien Nicolas <dm...@gmail.com>.
Hmmm actually, if I add a queue, it just move the problem. Any idea?

Le ven. 26 juil. 2019 à 14:46, Damien Nicolas <dm...@gmail.com> a
écrit :

> Hello,
> I have multiple sequential queues in InOut pattern, each queue leads to
> one processor.
> If a processor takes too much time for a treatment, I would like that the
> request-reply detects a timeout and send a timeout exception.
> The timeout with "*CamelJmsRequestTimeout*" works but only for the first
> queue.
>
> Example:
> If I have this:
>
> q1 -> p1 -> q2 -> p2 ->  q3 -> p3
>
> q1 *CamelJmsRequestTimeout *is for example 15". If each processor take
> 6", I will have a timeout at p3.
> I would like to have a reply to q1 after p1 and not after p3. And being
> able to modulate the timeout after each processing.
>
> This is an example code:
>
> from("jms:queue:q1")
>         .setExchangePattern(ExchangePattern.InOut)
>         .setHeader("CamelJmsRequestTimeout", constant("15000"))
>         .process("p1")
>         .to("jms:queue:q2");
>
> from("jms:queue:q2")
>         .setExchangePattern(ExchangePattern.InOut)
>         .setHeader("CamelJmsRequestTimeout", constant("5000"))
>         .process("p2")
>         .to("jms:queue:q3");
>
> from("jms:queue:q3")
>         .setExchangePattern(ExchangePattern.InOut)
>         .setHeader("CamelJmsRequestTimeout", constant("5000"))
>         .process("p3");
>
> I tried to double the concurrentConsumers (so from 1 to 2) on each
> procuder for the reply on the temp queue, but I still have this problem.
>
> Is my design possible? If yes, which option should I use?
>
> Thanks
>


-- 
Damien NICOLAS

Re: A question about reply timeout

Posted by Damien Nicolas <dm...@gmail.com>.
Writing my problem helps me to figure out how to solve it:

the message in q1 is injected from Spring and no queue for reply was
defined. I changed the exchange pattern of the q1 to InOnly, and now it
works.

Le ven. 26 juil. 2019 à 14:46, Damien Nicolas <dm...@gmail.com> a
écrit :

> Hello,
> I have multiple sequential queues in InOut pattern, each queue leads to
> one processor.
> If a processor takes too much time for a treatment, I would like that the
> request-reply detects a timeout and send a timeout exception.
> The timeout with "*CamelJmsRequestTimeout*" works but only for the first
> queue.
>
> Example:
> If I have this:
>
> q1 -> p1 -> q2 -> p2 ->  q3 -> p3
>
> q1 *CamelJmsRequestTimeout *is for example 15". If each processor take
> 6", I will have a timeout at p3.
> I would like to have a reply to q1 after p1 and not after p3. And being
> able to modulate the timeout after each processing.
>
> This is an example code:
>
> from("jms:queue:q1")
>         .setExchangePattern(ExchangePattern.InOut)
>         .setHeader("CamelJmsRequestTimeout", constant("15000"))
>         .process("p1")
>         .to("jms:queue:q2");
>
> from("jms:queue:q2")
>         .setExchangePattern(ExchangePattern.InOut)
>         .setHeader("CamelJmsRequestTimeout", constant("5000"))
>         .process("p2")
>         .to("jms:queue:q3");
>
> from("jms:queue:q3")
>         .setExchangePattern(ExchangePattern.InOut)
>         .setHeader("CamelJmsRequestTimeout", constant("5000"))
>         .process("p3");
>
> I tried to double the concurrentConsumers (so from 1 to 2) on each
> procuder for the reply on the temp queue, but I still have this problem.
>
> Is my design possible? If yes, which option should I use?
>
> Thanks
>


-- 
Damien NICOLAS