Jon Harper created AMQ-7040:
-------------------------------
Summary: consummer.receive(timeout) blocks infinitely if the
connection is not started for vm://localhost uris with policyentry
QueuePrefetch=0
Key: AMQ-7040
URL: https://issues.apache.org/jira/browse/AMQ-7040
Project: ActiveMQ
Issue Type: Bug
Reporter: Jon Harper
Attachments: QueuePrefetchBlockedTestCase.zip
Start a broker with
{code:xml}
<policyEntry queue=">" queuePrefetch="0"/>
{code}
Run "normal" client code but forget to start() the connection.
{code:java}
ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("failover:(tcp://localhost:61616)");
Connection con = connectionFactory.createConnection( );
//didn't call con.start()
Session session = con.createSession(true, Session.CLIENT_ACKNOWLEDGE);
Destination destination = session.createQueue("TEST.FOO");
final MessageConsumer consumer = session.createConsumer(destination);
consummer.receive(1000); //Blocks infinitely
}
{code}
Attached is a maven testcase that reproduces the problem:
{noformat}
$ mvn clean test
testQueuePrefetch0TCP OK
testQueuePrefetch0VM KO
Results :
Failed tests: testQueuePrefetch0VM(QueuePrefetchBlockedTestCase): receive
should not block more than 1 second
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
{noformat}
It works for tcp:// but not for vm://
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)