Bug 1004789 - attributes on messaging queue should be read-only
Summary: attributes on messaging queue should be read-only
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JMS
Version: 6.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ER3
: EAP 6.2.0
Assignee: Jeff Mesnil
QA Contact: Miroslav Novak
Russell Dickenson
URL:
Whiteboard:
: 1004715 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-05 13:40 UTC by Miroslav Novak
Modified: 2013-12-15 16:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-15 16:23:17 UTC
Type: Bug


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFLY-2071 0 Major Resolved Messaging queue attributes must be read-only 2014-08-11 15:19:57 UTC

Description Miroslav Novak 2013-09-05 13:40:18 UTC
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 09:10:20 UTC
there is no attached reproducer.zip

Comment 2 Miroslav Novak 2013-09-13 09:36:30 UTC
Created attachment 797223 [details]
reproducer.zip

Comment 3 Jeff Mesnil 2013-09-13 09:38:01 UTC
where are the source of the attached client.jar?

Comment 4 Miroslav Novak 2013-09-13 10:12:17 UTC
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 10:37:14 UTC
(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 11:20:09 UTC
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 15:37:41 UTC
Jeff Mesnil <jmesnil> made a comment on jira WFLY-2071

PR for master branch

Comment 9 Miroslav Novak 2013-09-18 06:46:35 UTC
*** Bug 1004715 has been marked as a duplicate of this bug. ***

Comment 10 JBoss JIRA Server 2013-09-23 06:39:35 UTC
Jeff Mesnil <jmesnil> made a comment on jira WFLY-2071

PR merged in master branch

Comment 12 Miroslav Novak 2013-10-07 08:08:49 UTC
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.