activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fran├žois Guillemette (JIRA) <>
Subject [jira] Commented: (AMQ-1251) Broker stops delivering messages to some consumers
Date Mon, 10 Sep 2007 17:27:23 GMT


Fran├žois Guillemette commented on AMQ-1251:

Hi all, 

I have tried revision 574216 of activemq trunk. I'm still having a problem when I set the
queue prefetch size to 1, when using a pure master slave configuration. Here what I have done:
1. Start two brokers, one master, one slave (with shutdownIfMasterFailure set to false).
2. Start one consumer (with prefetch set to 1), and with sleeptime = 5000 millisecond
3. Start one producer (for example: 10 durable messages)
4. After the consumer have consumed 1 or 2 messages, kill the master
5. The consumer will eat only one message from the slave (and they are more message in the

If the prefetch is not set, then the in step 5, the consumer will eat all the remaining messages.

> Broker stops delivering messages to some consumers
> --------------------------------------------------
>                 Key: AMQ-1251
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.1.0
>         Environment: WinXP
>            Reporter: Vadim Pesochinskiy
>            Assignee: Rob Davies
>             Fix For: 5.0.0
>         Attachments:,,
> I have around 40 consumers taking messages from a single queue. After awhile 1 or 2 consumers
stop receiveing any messages. Going to JMX and stopping corresponding connection causes re-connect
and messages are delivered again.
> I reproduced it twice in QA enviroment and now it happened in production. I tried to
instrument the code and set the log in debug, but that changed timing and I failed to reproduce
it after the changes.
> I suspect that runtime association b/w Queue and Consumer objects is lost on the Broker
> One of the suspects is the empty catch block in the RoundRobinDispatchPolicy (line 64)
class. It is possible that the CopyOnWrite array list is messed up and it fails when removed
consumer is added back. 
> BTW CopyOnWrite list is good when you mostly read, but not so good when you write for
every message delivery and empty catch blocks are bad in any case.
> if (firstMatchingConsumer != null) {
>       // Rotate the consumer list.
>       try {
>                 consumers.remove(firstMatchingConsumer);
>                 consumers.add(firstMatchingConsumer);
>       } catch (Throwable bestEffort) {
>       }
> }

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message