Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-5042

Session.commit() hangs when amqp+nio is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 5.9.0
    • 5.9.1, 5.10.0
    • AMQP
    • None

    Description

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

          @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();
          }
      

      Attachments

        1. testSessionTransactedCommit-non-NIO.txt
          13 kB
          Timothy A. Bish
        2. testSessionTransactedCommit-NIO.txt
          12 kB
          Timothy A. Bish
        3. testRollbackRececeivedMessage-non-NIO.txt
          7 kB
          Timothy A. Bish
        4. testRollbackRececeivedMessage-NIO.txt
          8 kB
          Timothy A. Bish

        Activity

          People

            tabish Timothy A. Bish
            tabish Timothy A. Bish
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: