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

consumer.receive hangs when receiving message of size 1Mb with amqp

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JBoss A-MQ 6.1
    • None
    • 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://0.0.0.0:5672"/>
      

      2) Using the following dependencies:

       <dependency>
                  <groupId>org.apache.qpid</groupId>
                  <artifactId>qpid-amqp-1-0-client-jms</artifactId>
                  <version>0.24</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:

      @Before
          public void init() throws JMSException, NamingException {
              //conFactiory=new ActiveMQConnectionFactory(BROKER_USERNAME,BROKER_PASSWORD,BROKER_URL);
          	// JNDI lookup of JMS Connection Factory and JMS Destination
              Context context = new InitialContext();
              conFactiory = (ConnectionFactory) context.lookup(CONNECTION_FACTORY_NAME);
              conn=conFactiory.createConnection();
              session=conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
              conn.start();
          }
      @Test
          public void testTextMessageQueue() throws JMSException, InterruptedException { 
          	Destination queue=session.createQueue(TEST_QUEUE);
              MessageProducer producer=session.createProducer(queue);
             // producer.setTimeToLive(250000000);     
              System.out.println("Here1");
              Message m=session.createTextMessage(Helper.createDataSize(1024));  
              System.out.println("Here2");
              producer.send(m);
              System.out.println("Here3");
              Thread.sleep(10 *1000);
              MessageConsumer  consumer=session.createConsumer(queue);
              System.out.println(LOG_MESSAGE+" Queue tests, receiving messages");
              Message message = consumer.receive(5000);
              Assert.assertNotNull(message);   
          }
      @Test
          public void testTextMessageQueue() throws JMSException, InterruptedException { 
          	Destination queue=session.createQueue(TEST_QUEUE);
              MessageProducer producer=session.createProducer(queue);  
              Message m=session.createTextMessage(Helper.createTextMessage(1024));  
              producer.send(m);
              Thread.sleep(10 *1000);
              MessageConsumer  consumer=session.createConsumer(queue);
              System.out.println(LOG_MESSAGE+" Queue tests, receiving messages");
              Message message = consumer.receive(5000);
              Assert.assertNotNull(message);   
          }
      

      And it hangs on consumer.receive(5000);

      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: //0.0.0.0:5672" /> 2) Using the following dependencies: <dependency> <groupId>org.apache.qpid</groupId> <artifactId>qpid-amqp-1-0-client-jms</artifactId> <version>0.24</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: @Before public void init() throws JMSException, NamingException { //conFactiory= new ActiveMQConnectionFactory(BROKER_USERNAME,BROKER_PASSWORD,BROKER_URL); // JNDI lookup of JMS Connection Factory and JMS Destination Context context = new InitialContext(); conFactiory = (ConnectionFactory) context.lookup(CONNECTION_FACTORY_NAME); conn=conFactiory.createConnection(); session=conn.createSession( false ,Session.AUTO_ACKNOWLEDGE); conn.start(); } @Test public void testTextMessageQueue() throws JMSException, InterruptedException { Destination queue=session.createQueue(TEST_QUEUE); MessageProducer producer=session.createProducer(queue); // producer.setTimeToLive(250000000); System .out.println( "Here1" ); Message m=session.createTextMessage(Helper.createDataSize(1024)); System .out.println( "Here2" ); producer.send(m); System .out.println( "Here3" ); Thread .sleep(10 *1000); MessageConsumer consumer=session.createConsumer(queue); System .out.println(LOG_MESSAGE+ " Queue tests, receiving messages" ); Message message = consumer.receive(5000); Assert.assertNotNull(message); } @Test public void testTextMessageQueue() throws JMSException, InterruptedException { Destination queue=session.createQueue(TEST_QUEUE); MessageProducer producer=session.createProducer(queue); Message m=session.createTextMessage(Helper.createTextMessage(1024)); producer.send(m); Thread .sleep(10 *1000); MessageConsumer consumer=session.createConsumer(queue); System .out.println(LOG_MESSAGE+ " Queue tests, receiving messages" ); Message message = consumer.receive(5000); Assert.assertNotNull(message); } And it hangs on consumer.receive(5000);

            kearls@redhat.com Kevin Earls (Inactive)
            emedvede Elena Medvedeva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: