Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7CDFF6662 for ; Fri, 8 Jul 2011 21:16:41 +0000 (UTC) Received: (qmail 61248 invoked by uid 500); 8 Jul 2011 21:16:41 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 61189 invoked by uid 500); 8 Jul 2011 21:16:40 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 61176 invoked by uid 99); 8 Jul 2011 21:16:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2011 21:16:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2011 21:16:38 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B68574E882 for ; Fri, 8 Jul 2011 21:16:16 +0000 (UTC) Date: Fri, 8 Jul 2011 21:16:16 +0000 (UTC) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Message-ID: <720434171.12430.1310159776744.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (AMQ-1295) Message lost and duplication with multiple consumers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMQ-1295?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Timothy Bish closed AMQ-1295. ----------------------------- Resolution: Cannot Reproduce > Message lost and duplication with multiple consumers > ---------------------------------------------------- > > Key: AMQ-1295 > URL: https://issues.apache.org/jira/browse/AMQ-1295 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.0.0 > Environment: Standalone broker, Oracle JDBC, no journal persisten= ce. > Reporter: Manuel Teira > Fix For: NEEDS_REVIEWED > > Attachments: JMSTestCP.java, planb.xml > > > Not sure about the exact conditions triggering this bug, but I was able t= o reproduce it multiple times using the attached client. What the client do= es is: > -Opens a connection. > -Creates a configurable number of threads to play the role of consumers i= n a given queue. > -The consumer creates a transacted session and fetches messages using= a JMSConsumer. > -Creates a configurable number of threads to play the role of producers i= n the given queue. > -Every consumer sends a given amount of messages to the queue, openin= g a AUTO_ACKNOWLEDGE session and a JMSProducer to send them. > The bug was detected running two clients simultaneously, with the configu= ration: > - 1 Producer > - 10 Consumers > - 1000 Messages > Sometimes one or two messages weren't delivered to the consumers. Running= a new client on the same queue didn't help. The only way to get the "froze= n" messages delivered was restarting the browser. > On other situations, some message was delivered twice. This was seen as t= he JMX console reported a queuesize =3D -2, and dequeuecount =3D enqueuecou= nt + 2. Also, a counter in the client updated for every received message s= hown the wrong count of messages.=C3=A7 > The situation is hard or imposible to reproduce if: > - You disable completely persistence. > - You add some synchronized code in the client, between the lines: > msg =3D consumer.receive(2000), > session.commit(); > like the commented statement incrConsumedCount(), perhaps shortening the = probability of a race condition. > - You run only a client at once (perhaps the problem only happens with co= nsumers from different connections simultaneously) > - If you don't use multicast to connect to the broker. I'm using, as jndi= .properties: > java.naming.provider.url =3D discovery:(multicast://planb.llu.xxxx) > and the same discoveryUri in a openwire connector in the broker. I'm atta= ching the client I've used and the configuration to reproduce the problem. > - I was not able to reproduce it using 4.1.1 -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira