Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-551

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JBoss A-MQ 6.1
    • JBoss A-MQ 6.1
    • broker
    • None
    • Hide

      Steps to reproduce:
      0) Uncomment line admin=admin,admin in etc/users.properties
      1)before starting fuse in etc/activemq.xml substitute line:

      <transportConnector name="openwire" uri="tcp://0.0.0.0:0?maximumConnections=1000"/>
      

      with

        <transportConnector name="amqp" uri="amqp+nio://localhost:5672"/> 
      

      2) Using the following dependencies:

      <dependency>
                  <groupId>org.apache.qpid</groupId>
                  <artifactId>qpid-amqp-1-0-client-jms</artifactId>
                  <version>0.26-SNAPSHOT</version>
              </dependency> 
              <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jms_1.1_spec</artifactId>
        <version>1.0</version>
      </dependency>
      

      I ran the following test:

              @Test
      	public void sessionTransactedTest() throws JMSException,
      			InterruptedException {
      		System.out.println(" sessionTransactedTest");
      
      		c = cf.createConnection();
      		c.start();
      		// transaction
      		Session transactedSession = c.createSession(true, 0);
      		Destination queue = transactedSession.createQueue("TransQueue");
      		MessageProducer pr = transactedSession.createProducer(queue);		
      		for (int i = 0; i < 10; i++) {
      			Message m = transactedSession.createTextMessage("TestMessage" + i);
      			pr.send(m);
      		}
      		MessageConsumer cons = transactedSession.createConsumer(queue);
      		TextMessage m = (TextMessage) cons.receive(5000);
      		System.out.println(" consumer message recieved");
      		Assert.assertNull(m);
      		transactedSession.commit();
      		System.out.println(" transaction commited");
      		transactedSession.close();
      		System.out.println(" transaction closed");
           }
      

      The test hangs on the line transactedSession.commit() in 90% of execution.

      Show
      Steps to reproduce: 0) Uncomment line admin=admin,admin in etc/users.properties 1)before starting fuse in etc/activemq.xml substitute line: <transportConnector name= "openwire" uri= "tcp: //0.0.0.0:0?maximumConnections=1000" /> with <transportConnector name= "amqp" uri= "amqp+nio: //localhost:5672" /> 2) Using the following dependencies: <dependency> <groupId>org.apache.qpid</groupId> <artifactId>qpid-amqp-1-0-client-jms</artifactId> <version>0.26-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-jms_1.1_spec</artifactId> <version>1.0</version> </dependency> I ran the following test: @Test public void sessionTransactedTest() throws JMSException, InterruptedException { System .out.println( " sessionTransactedTest" ); c = cf.createConnection(); c.start(); // transaction Session transactedSession = c.createSession( true , 0); Destination queue = transactedSession.createQueue( "TransQueue" ); MessageProducer pr = transactedSession.createProducer(queue); for ( int i = 0; i < 10; i++) { Message m = transactedSession.createTextMessage( "TestMessage" + i); pr.send(m); } MessageConsumer cons = transactedSession.createConsumer(queue); TextMessage m = (TextMessage) cons.receive(5000); System .out.println( " consumer message recieved" ); Assert.assertNull(m); transactedSession.commit(); System .out.println( " transaction commited" ); transactedSession.close(); System .out.println( " transaction closed" ); } The test hangs on the line transactedSession.commit() in 90% of execution.

      1. fuse.log
        24 kB
        Elena Medvedeva

            tbish@redhat.com Timothy Bish (Inactive)
            emedvede Elena Medvedeva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: