You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by arun196 <ar...@gmail.com> on 2015/03/06 17:37:41 UTC

help with timeout

I have a consumer that processes orders from messages received from activemq.
I would like to set a timeout in case the order processing takes over 5
minutes. 

I have property 'timeout' set in brokerURL. Looks like its not the one for
the requirement. Any ideas please?



--
View this message in context: http://activemq.2283324.n4.nabble.com/help-with-timeout-tp4692654.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: help with timeout

Posted by Tim Bain <tb...@alumni.duke.edu>.
The SlowAckConsumerAbortStrategy is definitely still live code.  But it
won't interrupt the client code; the broker will ask the client to abort,
but the client will finish processing the current message before honoring
the abort request.
On Mar 6, 2015 12:25 PM, "James A. Robinson" <ji...@highwire.org> wrote:

> On Fri, Mar 6, 2015 at 8:37 AM, arun196 <ar...@gmail.com> wrote:
> > I have a consumer that processes orders from messages received from
> activemq.
> > I would like to set a timeout in case the order processing takes over 5
> > minutes.
>
> I'm sorry, it's not clear to me from your description what
> it is that you are intending to effect with the timeout.
>
> Is the concern that the consumer has "gone away," and
> won't ever ack the message?  Or that the consumer is
> really really slow, but still working?  Is it possible that, if
> one waits long enough, that this 5+ minute message will
> finally be processed?
>
> Are you using transactions to handle the fetch/process/ack
> cycle?  I would think that would be one typical way to
> handle the problem, but your client has to handle the logic
> of deciding whether or not it can finally ack a message.
>
>
> http://www.javaworld.com/article/2074123/java-web-development/transaction-and-redelivery-in-jms.html
> http://activemq.apache.org/should-i-use-transactions.html
> http://activemq.apache.org/should-i-use-xa.html
> http://activemq.apache.org/redelivery-policy.html
>
> Looking around, I see that back in 5.9 the ActiveMQ folks
> introduced a broker-side configuration called
>
> abortSlowConsumerStrategy
>
> I'm not sure whether or not it's still active code, but
> here's an article discussing it when it was released:
>
>
> http://timbish.blogspot.com/2013/07/coming-in-activemq-59-new-way-to-abort.html
>
> If that's still available, it might be a way to force a
> timeout and redelivery if you know that the consumer
> has actually failed if it takes longer than specified
> time.
>
> Jim
>

Re: help with timeout

Posted by "James A. Robinson" <ji...@highwire.org>.
On Fri, Mar 6, 2015 at 8:37 AM, arun196 <ar...@gmail.com> wrote:
> I have a consumer that processes orders from messages received from activemq.
> I would like to set a timeout in case the order processing takes over 5
> minutes.

I'm sorry, it's not clear to me from your description what
it is that you are intending to effect with the timeout.

Is the concern that the consumer has "gone away," and
won't ever ack the message?  Or that the consumer is
really really slow, but still working?  Is it possible that, if
one waits long enough, that this 5+ minute message will
finally be processed?

Are you using transactions to handle the fetch/process/ack
cycle?  I would think that would be one typical way to
handle the problem, but your client has to handle the logic
of deciding whether or not it can finally ack a message.

http://www.javaworld.com/article/2074123/java-web-development/transaction-and-redelivery-in-jms.html
http://activemq.apache.org/should-i-use-transactions.html
http://activemq.apache.org/should-i-use-xa.html
http://activemq.apache.org/redelivery-policy.html

Looking around, I see that back in 5.9 the ActiveMQ folks
introduced a broker-side configuration called

abortSlowConsumerStrategy

I'm not sure whether or not it's still active code, but
here's an article discussing it when it was released:

http://timbish.blogspot.com/2013/07/coming-in-activemq-59-new-way-to-abort.html

If that's still available, it might be a way to force a
timeout and redelivery if you know that the consumer
has actually failed if it takes longer than specified
time.

Jim