message selector leaves messages on queue

Solution Verified - Updated -

Issue

  • In my environment I would like to use the auto-create queue functionality where a client will connect and automatically create the queue when it tries to receive the data. This works great, however I am having some issues with message-selector.
  • My client connects and has a message selector specified (ie.. session.createConsumer(queue, "color='green'"). This work fine and handy, however the problem is that all the messages that don't match the selector remain on the queue. I want to have the messages that don't match the selector get deleted from the queue.
  • some options I am wondering about
    • If I define a "filter" on the queue this will fix it, however I want to leave this logic within the client and have queues auto-created. So is there any way to have the jms client add a "filter" when "auto-creating" the queue?
    • if option #1 is not possible , programatically, how do I define the filter? is it possible using the jms api and not proprietary amq apis?
    • otherwise, is it somehow possible to have the client filter the messages on the client side using message selectors instead of the message filters applying on the server (which ends up leaving the message on the queue)

Environment

  • Red Hat AMQ
    • 7.2.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.