I'm experiencing a related issue. I think understand what's happening but was hoping there's a solution to make it do like I need it to do. My queue processes a large volume of messages. And there are high priority messages that should be processed first. If the dequeue loop is entered where there are a large number of low priority messages, it starts processing the messages using dequeue_array. This is a multi-group queue, so messages will be grouped per transaction. This much is working fine. But if after the dequeuing starts, if a higher priority message arrives on the queue, it will not be seen by the dequeuing already in progress. As I watch what's happening, it runs as if the first dequeue call has opened a cursor and will continue to process the message in the cursor until the last message is processed. If new messages arrive on the queue after that initial dequeue, they will not be seen until the cursor closes and a new cursor is opened with another dequeue. Is there a way to make the new higher priority message visible to the running dequeue so that it will be process upon arrival?
I've posted this inquiry as a reponse here, but will also start a new post if I can.