You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by fliot <fr...@liot.org> on 2016/02/22 10:06:48 UTC

Activemq initialDelay ?

Hi,

The same way there is a file2 consumer initialDelay option,
Is there something equivalent for activemq component ?

I know I can use "delay" after having obtain the message from the activemq
queue,
But the idea is, exactly as it is done with file2 component, to let the
message in place/in queue, during such initial delay.

Thank in advance,

Francois



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-initialDelay-tp5778033.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq initialDelay ?

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
You could make your second/backup route timer driven - that may accomplish what you’re after.

from( “timer:my-timer?period=5000 ).
    .pollEnrich( “jms….”, timeout)

You’d probably need to make this route enable some other route to drain the queue if it found a message, and then have that route stop when it’s done.

It may be a little too convoluted - but I thought I’d throw it out there.


> On Feb 22, 2016, at 11:50 AM, fliot <fr...@liot.org> wrote:
> 
> My camel consumers are not geographically at the same distance from broker,
> And network bandwith have some cost...
> 
> I just reviewed the exclusive consumer documentation, it doesn't fit exactly
> to my need,
> I was looking for something like a balance factor, with which I could set to
> define how consumer can act.
> 
> Thanks anyway for the answer.
> 
> Regards.
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Activemq-initialDelay-tp5778033p5778075.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Activemq initialDelay ?

Posted by Claus Ibsen <cl...@gmail.com>.
You could look at route policy, and then let the "failover" routes do
a thread sleep before they start, the route policy has some apis you
can hook into the lifecycle of the route.

You would need to figure out somehow which route is the master and not
sleep for that one.

On Mon, Feb 22, 2016 at 7:50 PM, fliot <fr...@liot.org> wrote:
> My camel consumers are not geographically at the same distance from broker,
> And network bandwith have some cost...
>
> I just reviewed the exclusive consumer documentation, it doesn't fit exactly
> to my need,
> I was looking for something like a balance factor, with which I could set to
> define how consumer can act.
>
> Thanks anyway for the answer.
>
> Regards.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Activemq-initialDelay-tp5778033p5778075.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

Re: Activemq initialDelay ?

Posted by fliot <fr...@liot.org>.
My camel consumers are not geographically at the same distance from broker,
And network bandwith have some cost...

I just reviewed the exclusive consumer documentation, it doesn't fit exactly
to my need,
I was looking for something like a balance factor, with which I could set to
define how consumer can act.

Thanks anyway for the answer.

Regards.



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-initialDelay-tp5778033p5778075.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq initialDelay ?

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
What is the reasoning behind having the second consumer only process in the case of failover or slow processing?  

If you could deploy multiple instances of the consumer, you’d get the throughput you’re after.  Also, if you want to ensure that only one consumer is actively processing messages at any given time, you could use exclusive consumers (http://activemq.apache.org/exclusive-consumer.html <http://activemq.apache.org/exclusive-consumer.html> ).

You can probably get the “slow processing” worked out using something similar to the example in the Camel ActiveMQ Broker Component documentation (http://activemq.apache.org/broker-camel-component.html <http://activemq.apache.org/broker-camel-component.html>).  The example works on queue depth - I don’t know if that would work for you or not.



> On Feb 22, 2016, at 10:32 AM, fliot <fr...@liot.org> wrote:
> 
> Thanks Quinn for your feedbac,
> 
> Here is my test case,
> 
> A single ActiveMQ broker, several Camel consumers,
> And I want one of these consumer get messages without delay (letting him
> consume messages before the others, and other acting in case of fail-over or
> too long time for the first instance).
> 
> Thanks in advance.
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Activemq-initialDelay-tp5778033p5778067.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Activemq initialDelay ?

Posted by fliot <fr...@liot.org>.
Thanks Quinn for your feedbac,

Here is my test case,

A single ActiveMQ broker, several Camel consumers,
And I want one of these consumer get messages without delay (letting him
consume messages before the others, and other acting in case of fail-over or
too long time for the first instance).

Thanks in advance.



--
View this message in context: http://camel.465427.n5.nabble.com/Activemq-initialDelay-tp5778033p5778067.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Activemq initialDelay ?

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Can you provide a little more information on your use case?  I’m having a little trouble understanding why you want an initialDelay for a JMS consumer.

As you started, the file component has the initialDelay URI parameter to allow a little time before the component starts polling for the file.  JMS however isn’t a polling consumer - the JMS message will be delivered and an exchange will be created as soon as a message is available.

Is there a problem with just waiting for the message to arrive?

> On Feb 22, 2016, at 2:06 AM, fliot <fr...@liot.org> wrote:
> 
> Hi,
> 
> The same way there is a file2 consumer initialDelay option,
> Is there something equivalent for activemq component ?
> 
> I know I can use "delay" after having obtain the message from the activemq
> queue,
> But the idea is, exactly as it is done with file2 component, to let the
> message in place/in queue, during such initial delay.
> 
> Thank in advance,
> 
> Francois
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Activemq-initialDelay-tp5778033.html
> Sent from the Camel - Users mailing list archive at Nabble.com.