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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.9.0
    • Fix Version/s: 5.9.1, 5.10.0
    • Component/s: AMQP
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: