-
Bug
-
Resolution: Obsolete
-
Undefined
-
None
-
AMQ 7.10.2.GA
-
None
-
False
-
None
-
False
-
-
-
-
Important
Steps to reproduce:
- Unpack the attached `amqpconsume.zip`
- `mvn package`
- Start a broker with a clean message store and default configuration
- Edit `App.java` to change broker host, port, credentials, etc., if required
- Run `java -jar target amqpconsume-0.0.1-jar-with-dependencies.jar`
- Note that no message is consumed, even though one is clearly sent.
The test application creates a queue producer and a consumer in the same session. The producer sends messages, then the consumer receives them. If the consumer calls `receive(timeout)` then it will sometimes return `null`, however long the timeout. If it calls `receive()` it will sometimes block, even though the producer just sent a message.
I believe that this problem arises because, when the message is sent, the broker does not know that anycast (queue) semantics are needed. If the broker processes the incoming messages before the consumer is set up, it will assume anycast (topic) semantics, and discard the message because there are no consumers on the topic.
The problem is not 100% reproducible, and seems to depend on subtle timing variations between test runs and environments.