Timothy Bish created AMQ-5042:
---------------------------------

             Summary: Session.commit() hangs when amqp+nio is used
                 Key: AMQ-5042
                 URL: https://issues.apache.org/jira/browse/AMQ-5042
             Project: ActiveMQ
          Issue Type: Bug
          Components: AMQP
    Affects Versions: 5.9.0
            Reporter: Timothy Bish
            Assignee: Timothy Bish
            Priority: Critical
             Fix For: 5.10.0


The follow test will cause a hang when run against amqp+nio transport.

{code}
    @Test(timeout=30000)
    public void testSessionTransactedCommit() throws JMSException, 
InterruptedException {
        ActiveMQAdmin.enableJMSFrameTracing();

        Connection connection = createConnection();
        Session session = connection.createSession(true, 
Session.AUTO_ACKNOWLEDGE);
        Queue queue = session.createQueue(name.toString());

        connection.start();

        // transacted producer
        MessageProducer pr = session.createProducer(queue);
        for (int i = 0; i < 10; i++) {
            Message m = session.createTextMessage("TestMessage" + i);
            pr.send(m);
        }

        // No commit in place, so no message should be dispatched.
        MessageConsumer consumer = session.createConsumer(queue);
        TextMessage m = (TextMessage) consumer.receive(5000);

        assertNull(m);

        session.commit();

        // Messages should be available now.
        for (int i = 0; i < 10; i++) {
            Message msg = consumer.receive(5000);
            assertNotNull(msg);
        }

        session.close();
        connection.close();
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to