[rabbitmq-discuss] Redelivery of unacknowledged messages
jonatan at heysan.com
Fri Oct 3 18:26:23 BST 2008
Ben, Mathias, Gordon,
Thanks for your answers.
The system around the queue involves a few web servers using php to enqueue
messages at almost every page load and a single java application that
subscribes to the queue and makes one http request to another site for each
message. (To take load off from the web servers and to make their flow
asynchronous, in opposite to when they made the http request themselves.)
The http request usually takes around 50 ms, but sometimes more and
sometimes they fail or timeout after 60 s. We are using a number of
concurrent connections for the http client, not to let a single http request
timing out block the queue. The RabbitMQ subscriber starts threads that
handles the http requests as long as there are available http connections,
if there are no available http connections, the handleDelivery method waits
(while-loop) for a free connection, thus blocking from receiving more
messages until there is time to handle them.
Currently I acknowledge messages that results in a successful http request,
but any message that fails due to issues outside of our system (timeouts
etc.) does not get acknowledged, since we want them to be delivered again
I am trying not to have any concept of a queue inside of the java
applications since that is the MQs responsibility and to avoid loss of
messages on a crash.
Since I started this thread I have realized that it might be smarter to
retry with messages that fail due to timeouts until they succeed instead of
throwing them away and wait for a redelivery.
It is not an issue of load balancing and to do it the way I do it now,
basic.reject is probably what I need.
I'm thankful for, and interested in, any thoughts and ideas.
On Thu, Oct 2, 2008 at 11:35 PM, Ben Hood <0x6e6562 at gmail.com> wrote:
> On Fri, Oct 3, 2008 at 3:25 AM, Matthias Radestock <matthias at lshift.net>
> > I am not at all sure that Basic.Reject is what Jonatan needs.
> Potentially not. I probably left too much of the original context of a
> similar question that I answered off list last week. I did ask that
> person I they would mind me turning their conversation into a list
> topic for the benefit of everybody, but they never did get back to me.
> So you and Gordon rightfully point out, it would be better if Jonatan
> told us exactly what functionality his application requires.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss