Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 43644 invoked from network); 19 Feb 2009 15:30:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Feb 2009 15:30:21 -0000 Received: (qmail 82896 invoked by uid 500); 19 Feb 2009 15:30:20 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 82873 invoked by uid 500); 19 Feb 2009 15:30:20 -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 82862 invoked by uid 99); 19 Feb 2009 15:30:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Feb 2009 07:30:20 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Feb 2009 15:30:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7B45E234C498 for ; Thu, 19 Feb 2009 07:29:59 -0800 (PST) Message-ID: <1673448547.1235057399503.JavaMail.jira@brutus> Date: Thu, 19 Feb 2009 07:29:59 -0800 (PST) From: "Gary Tully (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQ-2125) javax.jms.JMSException: Could not correlate acknowledgment with dispatched message thrown on failover In-Reply-To: <155794312.1234959539368.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-2125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=49794#action_49794 ] Gary Tully commented on AMQ-2125: --------------------------------- This exception is expected on failover if a transaction was in progress at the point of failover. The failover transport on the client side has a state tracker for commands and transactions that have been sent so that it can recreate its state on the failover broker. In the case of a transaction commit that is out standing, the message acks will be replayed as part of the commit, the transaction will be replayed but the messages will not be present (as dispatched messages to a consumer ) on the failover broker, they will still be in the store as the original tx will have rolledback when the connection was dropped. These messages will be subsequently be redelivered. The exception occurs when the message corresponding to the ack cannot be found as pending in the broker but it can be safely ignored. Just to be sure this is what is occurring, is it possible to provide a log of both brokers with full logging enabled. > javax.jms.JMSException: Could not correlate acknowledgment with dispatched message thrown on failover > ----------------------------------------------------------------------------------------------------- > > Key: AMQ-2125 > URL: https://issues.apache.org/activemq/browse/AMQ-2125 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.2.0 > Environment: MacOS 10.5 and Solaris 10 > Reporter: Team Hiro > > When failing over to a new broker we see this exception. Although the exception is thrown no messages seem to be lost. > This can be reproduced using the following unit test and this setup: > 1. Create two activemq's using the same datasource. > 2. Run the test > 3. Kill the first active mq before the test completes (after you see the first Recieved Message... in the system out) > 4. See the exception thrown in the second activemq log > import org.apache.activemq.ActiveMQConnectionFactory; > import javax.jms.*; > import static javax.jms.Session.AUTO_ACKNOWLEDGE; > import static javax.jms.Session.SESSION_TRANSACTED; > import junit.framework.TestCase; > import java.util.concurrent.atomic.AtomicInteger; > public class BrokerTest extends TestCase { > public void testFoo() throws Exception { > ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("failover:(tcp://localhost:61616,tcp://localhost:61617)"); > Connection connection = connectionFactory.createConnection(); > connection.start(); > Session producerSession = connection.createSession(false, AUTO_ACKNOWLEDGE); > MessageProducer producer = producerSession.createProducer(producerSession.createQueue("testQueue")); > for (int i = 0; i < 100; i++) { > System.out.println("Sending messages"); > producer.send(producerSession.createTextMessage("Hello")); > } > final AtomicInteger atomicInteger = new AtomicInteger(0); > final Session consumerSession = connection.createSession(true, SESSION_TRANSACTED); > MessageConsumer messageConsumer = consumerSession.createConsumer(consumerSession.createQueue("testQueue")); > messageConsumer.setMessageListener(new MessageListener() { > public void onMessage(Message message) { > try { > System.out.println("Received Message" + message); > Thread.sleep(1000); > atomicInteger.addAndGet(1); > System.out.println(atomicInteger.get()); > consumerSession.commit(); > } catch (Exception e) { > throw new RuntimeException("Oh dear", e); > } > } > }); > Thread.sleep(2 * 60 * 1000); > assertEquals(100, atomicInteger.get()); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.