Description of problem: When message selector is set on queue "testQueue" by: /subsystem=messaging/hornetq-server=default/jms-queue=testQueue:write-attribute(name=selector,value="color='RED'") then this is not reflected and all messages sent by producer which do not hold the condition in selector get to queue. Steps to Reproduce: Download and unzip reproducer.zip: - Run "sh prepare.sh" - Start server by: sh start-server1.sh 127.0.0.1 - In CLI run following commands: /subsystem=messaging/hornetq-server=default/jms-queue=testQueue:add(durable=true, entries=["java:jboss/exported/jms/queue/testQueue","jms/queue/testQueue"]) /subsystem=messaging/hornetq-server=default/jms-queue=testQueue:write-attribute(name=selector,value="color='RED'") - Start producer by: sh start-producer.sh 127.0.0.1 jms/queue/testQueue 10 - Start consumer by: sh start-consumer.sh 127.0.0.1 jms/queue/testQueue Actual results: Consumer gets 10 messages. Expected results: Consumer should get 5 messages (with color='RED' property)
there is no attached reproducer.zip
Created attachment 797223 [details] reproducer.zip
where are the source of the attached client.jar?
Created attachment 797258 [details] client-maven-project.zip It's using dependency from our engineering repo where you probably don't have access but you can still specify different dependencies for this client. Used classes: org.jboss.jms.client.TestProducer org.jboss.jms.client.TestConsumer
(In reply to Miroslav Novak from comment #0) > - In CLI run following commands: > /subsystem=messaging/hornetq-server=default/jms-queue=testQueue: > add(durable=true, > entries=["java:jboss/exported/jms/queue/testQueue","jms/queue/testQueue"]) > /subsystem=messaging/hornetq-server=default/jms-queue=testQueue:write- > attribute(name=selector,value="color='RED'") The test setup is not correct. You add a JMS queue *without* a selector. When you write the selector attribute, please not that the server replied that a reload is required: /subsystem=messaging/hornetq-server=default/jms-queue=testQueue:write-attribute(name=selector,value="color='RED'") { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } } That's why your consumer receives all the message: the server has not been reloaded and the selector you added has not been taken into account. If you change the test setup to add the queue with the selector, your consumer will receive only the filtered out message: /subsystem=messaging/hornetq-server=default/jms-queue=testQueue:add(durable=true, entries=["java:jboss/exported/jms/queue/testQueue","jms/queue/testQueue"], selector="color='RED'")
Thanks Jeff for feedback. You're right that when queue is added with selector then everything is ok and just 'RED' messages are received by consumer. If selector is specified after queue was created then I can see that consumer receives all messages. Reload or restart of server has no effect.
Jeff Mesnil <jmesnil> made a comment on jira WFLY-2071 PR for master branch
*** Bug 1004715 has been marked as a duplicate of this bug. ***
Jeff Mesnil <jmesnil> made a comment on jira WFLY-2071 PR merged in master branch
Verified in EAP 6.2.0.ER4. Attribute selector on queue is read-only now. Thanks Jeff for the change.