Bug 1004789 - attributes on messaging queue should be read-only
attributes on messaging queue should be read-only
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JMS (Show other bugs)
6.1.1
Unspecified Unspecified
unspecified Severity low
: ER3
: EAP 6.2.0
Assigned To: Jeff Mesnil
Miroslav Novak
Russell Dickenson
:
: 1004715 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-05 09:40 EDT by Miroslav Novak
Modified: 2013-12-15 11:23 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-15 11:23:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
reproducer.zip (44.57 KB, application/zip)
2013-09-13 05:36 EDT, Miroslav Novak
no flags Details
client-maven-project.zip (50.51 KB, application/zip)
2013-09-13 06:12 EDT, Miroslav Novak
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-2071 Major Resolved Messaging queue attributes must be read-only 2014-08-11 11:19:57 EDT

  None (edit)
Description Miroslav Novak 2013-09-05 09:40:18 EDT
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)
Comment 1 Jeff Mesnil 2013-09-13 05:10:20 EDT
there is no attached reproducer.zip
Comment 2 Miroslav Novak 2013-09-13 05:36:30 EDT
Created attachment 797223 [details]
reproducer.zip
Comment 3 Jeff Mesnil 2013-09-13 05:38:01 EDT
where are the source of the attached client.jar?
Comment 4 Miroslav Novak 2013-09-13 06:12:17 EDT
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
Comment 5 Jeff Mesnil 2013-09-13 06:37:14 EDT
(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'")
Comment 6 Miroslav Novak 2013-09-13 07:20:09 EDT
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.
Comment 7 JBoss JIRA Server 2013-09-13 11:37:41 EDT
Jeff Mesnil <jmesnil@redhat.com> made a comment on jira WFLY-2071

PR for master branch
Comment 9 Miroslav Novak 2013-09-18 02:46:35 EDT
*** Bug 1004715 has been marked as a duplicate of this bug. ***
Comment 10 JBoss JIRA Server 2013-09-23 02:39:35 EDT
Jeff Mesnil <jmesnil@redhat.com> made a comment on jira WFLY-2071

PR merged in master branch
Comment 12 Miroslav Novak 2013-10-07 04:08:49 EDT
Verified in EAP 6.2.0.ER4. Attribute selector on queue is read-only now. Thanks Jeff for the change.

Note You need to log in before you can comment on or make changes to this bug.