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

No message received with prefetch 0 over http

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.14.5
    • Fix Version/s: 5.15.1, 5.16.0
    • Component/s: Connector
    • Labels:
      None
    • Environment:

      Windows, Linux

      Description

      The http connector doesn't seem to work with prefetchSize 0.
      It works with tcp connector.

      AMQ configuration:

              <transportConnectors>
                  <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
                  <transportConnector name="http" uri="http://0.0.0.0:8080"/>
              </transportConnectors>
      

      Code to reproduce:

      	String brokerURL = "http://localhost:8080";
      	//String brokerURL = "tcp://localhost:61616";
      	ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(brokerURL);
      	ActiveMQPrefetchPolicy pp = new ActiveMQPrefetchPolicy();
      	pp.setQueuePrefetch(0);
      	cf.setPrefetchPolicy(pp);
      	Connection con = cf.createConnection();
      	con.start();
      	Session s = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
      	Destination d = s.createQueue("test");
      	MessageProducer p = s.createProducer(d);
      	MessageConsumer c = s.createConsumer(d);
      	Message m = new ActiveMQTextMessage();
      	m.setStringProperty("test", "test");
      	p.send(m);
      	c.receive();
      	p.close();
      	s.close();
      	con.stop();
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: