Bug 1004715

Summary: CLI - any string is allowed to set for message selector on queue
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Miroslav Novak <mnovak>
Component: HornetQAssignee: Jeff Mesnil <jmesnil>
Status: CLOSED DUPLICATE QA Contact: Miroslav Novak <mnovak>
Severity: low Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.1.1CC: ataylor, csuconic, jdoyle, jmesnil, msvehla
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-18 06:46:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Novak 2013-09-05 10:23:57 UTC
Description of problem:
Using CLI is possible to set message selector on queue to any string value. Such selector does not have to correspond to message selector syntax.

How reproducible:

Add queue:

/subsystem=messaging/hornetq-server=default/jms-queue=testQueue:add(durable=true,entries=["java:jboss/exported/jms/queue/testQueue"]

Set message selector with bad value:

/subsystem=messaging/hornetq-server=default/jms-queue=testQueue:write-attribute(name=selector,value="dsa=AND$2==^#%!=fasd")
{
    "outcome" => "success",
    "response-headers" => {
        "operation-requires-reload" => true,
        "process-state" => "reload-required"
    }
}

Expected results:
This should fail with description of proper grammar.

Comment 1 Jeff Mesnil 2013-09-05 10:26:35 UTC
HornetQ does not expose any functionality to determine the correctness of a message selector.

Either it needs to provide it or it should check it at runtime when the queue is created.

Comment 2 Miroslav Novak 2013-09-05 11:29:05 UTC
JMS specification 1.1 [1] describes message selector syntax  in chapter: 3.8.1.1 Message Selector Syntax

[1] http://docs.oracle.com/cd/E19957-01/816-5904-10/816-5904-10.pdf

Comment 3 Clebert Suconic 2013-09-17 21:22:13 UTC
I believe had already changed this on wildfly/master.

The issue here is that a queue's filter is a read only property.


Was this changed on 6.x as well?  if so, this is just a close

Comment 4 Miroslav Novak 2013-09-18 06:46:35 UTC
Yes, message-selector attribute should be read-only. Jeff has already created PR in bz#1004789.

I'll close this bz as duplicate.

*** This bug has been marked as a duplicate of bug 1004789 ***