activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Pesochinskiy (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-1251) Broker stops delivering messages to some consumers
Date Thu, 23 Aug 2007 17:29:22 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40002
] 

Vadim Pesochinskiy commented on AMQ-1251:
-----------------------------------------

David, 

You may be having a different issue though. If you have idle consumers some messages can be
stack in the pre-fetch buffer. You can check this out by setting pre-fetch buffer to 0 for
all consumer connections, but keep in mind that it does not work with asynchronous MessageListener
interface. You have to call recieve*(*) methods for it to work. 

Pre-fetch buffer is on the client / consumer JVM. Messages are pushed to the consumer until
the buffer size is not exceeded. This is a performance solution, so if you are not getting
1000 msgs/sec you can pull messages from the queue with prefetchSize = 0.

To set prefetch size you can use this code or google amq site to figure out how to set it
in connection URL.

            ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(user, password, url);
            cf.setPrefetchPolicy(getPrefetchPolicy());


Regards.

> Broker stops delivering messages to some consumers
> --------------------------------------------------
>
>                 Key: AMQ-1251
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1251
>             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
>
>
> 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
side. 
> 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.


Mime
View raw message