If this is not a bug, the documentation might need an update, as I'm not aware of what I did wrong.
Here is a test case, you will need two ipython consoles.
(The receiver is named cleaner because it is only supposed to "free" the queue from any old messages.)
Back to the first console:
This message does not arrive at the second console. The receiver.fetch() still blocks.
I have the following observations about this situation:
- One workaround is to call cleaner.close(), the blocking receiver will immediately return the message.
- Another workaround is to specify a time-out in the receiver.fetch() call (test it with timeout=60). The message will be returned, though only at the end of the time-out!
- Sending a second message will result in immediate delivery of the first message.
- Once the situation is unblocked, you have to start anew in order to experience the blocking situation again. Don't forget to call session.acknowledge() before ending the console 2, or use a fresh queue.
- The problem only manifests itself when receiver.fetch() starts before the message is sent.