activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiram Chirino" <hi...@hiramchirino.com>
Subject Re: Consumer Deadlock
Date Fri, 28 Jul 2006 19:32:51 GMT
Hi osian,

I have see something similar to this before.  Please use a JMX console and
look at the broker memory percentage used attribute.  I bet that it is
reaching 100% and then everything deadlocks.  Let me outline the scenario:

You are probably sending a good amount of messages (either in volume or in
size) to the broker.  The broker starts to flow control the producers (stop
them from being able to send more messages) so that his configured in memory
message buffers are not exeeded (configured to 20 megs by default).
Normally this is not a problem if you have a consumer receiving messages and
not trying to send messages back into the system.  But since your consumer
is not acking the message until after he sends more messages, he too
blocks.  Since he his blocked no more messages are dequeued and hence you
have network deadlock.

There are 2 ways to fix this.  1st is to ack the message in the consumer
before it sends more messages.  The 2nd it to configure per destination
buffer limits, and always have your consume publish to a different
destination than what it consumed from.

You configure the destination memory limits using destination policy
configuration in activemq.xml
<broker>
...
   <destinationPolicy>
      <policyMap><policyEntries>
          <*policyEntry* topic=">" *memoryLimit*="50000000"/>
          <*policyEntry* queue=">" *memoryLimit*="50000000"/>
      </policyEntries></policyMap>
    </destinationPolicy>
....
</broker>

On 7/28/06, osian <osian@osian.me.uk> wrote:
>
>
> I seem to be hitting a consumer deadlock situation.  The configuration is
> the
> standard, out of the box activemq.xml, I start up 3 consumers, using a
> queueConneciton, a queueSession(true, auto_ack), and a queueReceiver.
>
> Once the queueReceiver gets a message, it processes it, and during the
> processing it might generate n number of messages, and then at the end of
> the process, it will commit the queueSession.
>
> Am I missing something here? I would have thought that this is a standard
> config and test to be performed.  Any help would be greatly appreciated.
>
> Note, that this is all running on the same box.
> --
> View this message in context:
> http://www.nabble.com/Consumer-Deadlock-tf2014492.html#a5536571
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message