The messages in a queue will be delivered right away if there is any active consumers. However, if the messages are 'rejected' by the selector and go back to queue, they won't get delivered again if the consumer remains the same. So for your case, I suggest you can have your consumer to be configurable in some way, or have a new consumer for each selector. for example:
you create a consumer with selector that only consumes messages with flag Y.
after some time you need message with N, you can dynamically create a consumer with selector N and consume the messages.