Bug 1083015 - [Selectors] amqp header fields does not select
Summary: [Selectors] amqp header fields does not select
Keywords:
Status: MODIFIED
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 3.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: Andrew Stitcher
QA Contact: Messaging QE
URL:
Whiteboard:
: 1082959 (view as bug list)
Depends On:
Blocks: 1113461
TreeView+ depends on / blocked
 
Reported: 2014-04-01 10:28 UTC by Zdenek Kraus
Modified: 2015-09-04 18:20 UTC (History)
2 users (show)

Fixed In Version: 3.2
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Zdenek Kraus 2014-04-01 10:28:08 UTC
Description of problem:
filter addressing the correlation_id filed is not working

Version-Release number of selected component (if applicable):
qpid-cpp-server-0.22-36

How reproducible:
100%

Steps to Reproduce:
1. ./qc2_spout --log-msgs dict -c 2 --correlation-id "asdf" "q;{create:always}"
2. ./qc2_drain --log-msgs dict -c 1 "q;{link:{selector:\"amqp.correlation-id = 'asdf'\"}}"
3. ./qc2_drain --log-msgs dict -c 1 "q;{link:{selector:\"amqp.correlation_id = 'asdf'\"}}"
4. ./qc2_drain --log-msgs dict -c 1 "q;{link:{selector:\"correlation-id = 'asdf'\"}}"
5. ./qc2_drain --log-msgs dict -c 1 "q;{link:{selector:\"correlation_id = 'asdf'\"}}"
6. ./qc2_drain --connection-options "{protocol:amqp1.0}" --log-msgs dict -c 1 "q;{link:{selector:\"amqp.correlation-id = 'asdf'\"}}"
7. ./qc2_drain --connection-options "{protocol:amqp1.0}" --log-msgs dict -c 1 "q;{link:{selector:\"amqp.correlation_id = 'asdf'\"}}"
8. ./qc2_drain --connection-options "{protocol:amqp1.0}" --log-msgs dict -c 1 "q;{link:{selector:\"correlation-id = 'asdf'\"}}"
9. ./qc2_drain --connection-options "{protocol:amqp1.0}" --log-msgs dict -c 1 "q;{link:{selector:\"correlation_id = 'asdf'\"}}"

 


Actual results:
[1]
{'redelivered': False, 'reply_to': None, 'subject': None, 'content_type': None, 'id': None, 'user_id': None, 'correlation_id': 'asdf', 'priority': 0, 'durable': False, 'ttl': 0, 'properties': {'spout-id': '2979bc0a-dd44-4449-8020-1441421803af:0'}, 'content': None}
{'redelivered': False, 'reply_to': None, 'subject': None, 'content_type': None, 'id': None, 'user_id': None, 'correlation_id': 'asdf', 'priority': 0, 'durable': False, 'ttl': 0, 'properties': {'spout-id': '22020189-900d-45ce-916d-28ebf91f0b08:1'}, 'content': None}

[2-9] Nothing



Expected results:
[3] and [7] have to read a message because selector should be true

Additional info:
putting manualy the property 'correlation_id' to properties of the message as table here http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Selector.cpp?revision=1559017&view=markup suggests does not make the difference. Correlation ID isn't definitely in the properties according to qpid C++ API https://qpid.apache.org/releases/qpid-0.22/messaging-api/cpp/api/classqpid_1_1messaging_1_1Message.html

Comment 3 Zdenek Kraus 2014-04-01 10:40:23 UTC
Also other headers selectors according to this table don't work.
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Selector.cpp?revision=1559017&view=markup

for example:
2014-04-01 12:34:31 [Broker] debug Selector identifier: amqp.jms_type->STRING:''
2014-04-01 12:35:03 [Broker] debug Selector identifier: amqp.delivery_count->UNKNOWN
2014-04-01 12:33:24 [Broker] debug Selector identifier: amqp.absolute_expiry_time->STRING:''
2014-04-01 12:30:52 [Broker] debug Selector identifier: amqp.to->STRING:''
2014-04-01 12:29:09 [Broker] debug Selector identifier: amqp.reply_to->STRING:''
2014-04-01 12:28:46 [Broker] debug Selector identifier: amqp.message_id->STRING:''



except for priority
2014-04-01 12:28:59 [Broker] debug Selector identifier: amqp.priority->EXACT:0


also please see Bug 1082959 for durable (may be probably be closed as clone)



Additional issue, other headers cannot be used for selector ? NEEDINFO(astitcher@redhat.com)

Comment 4 Justin Ross 2014-04-01 13:16:53 UTC
*** Bug 1082959 has been marked as a duplicate of this bug. ***

Comment 5 Andrew Stitcher 2014-04-04 21:28:04 UTC
I'm exactly clear what you are asking but this is the list of unimplemented special ids:

amqp.to
amqp.reply_to

(These will always return "")

These are the implemented special ids:
amqp.delivery_mode
amqp.redelivered
amqp.priority
amqp.correlation_id
amqp.message_id
amqp.absolute_expiry_time
amqp.creation_time
amqp.jms_type

There are no other special identifiers in particular amqp.durable and amqp.delivery_count are not defined as they have no JMS* equivalent. They represent native amqp headers used to calculate the mapped JMS identifier.
At least that is how I interpret the spec we follow:

https://svn.apache.org/repos/asf/qpid/trunk/qpid/specs/apache-filters.xml#type-selector-filter

The in source file documentation is misleading on this point.

You cannot just create all these properties by explicitly adding a property to the message as some/most of them are specially constructed from the message. Indeed if you could just add a property to get them you wouldn't really need a special syntax for them.

Comment 6 Andrew Stitcher 2014-04-04 22:03:06 UTC
Sorry that comment #5 relates to the state of the code as released in the upstream 0.28.

The MRG 3.0 release only implements
amqp.delivery_mode
amqp.redelivered
amqp.priority

all other special identifiers are not implemented.

Comment 7 Andrew Stitcher 2014-04-29 19:38:44 UTC
To be clear, The correlation_id property is *NOT* implemented in this release of MRG.

Comment 8 Zdenek Kraus 2014-04-30 05:54:50 UTC
Does that mean that all others, currently unimplemented won't be implemented either?

this could be list of unimplemented headers:

amqp.to
amqp.reply_to
amqp.priority
amqp.correlation_id
amqp.message_id
amqp.absolute_expiry_time
amqp.creation_time
amqp.jms_type

Comment 10 Zdenek Kraus 2014-04-30 13:07:14 UTC
To prevent any further misunderstanding, that this issue is about all unimplemented headers, not just correlation_id (I've just tested correlation_id first) I'm changing the name of this bug.

also clearing NEEDINFO(astitcher) since it's ->3.1

Comment 11 Andrew Stitcher 2014-05-02 15:05:44 UTC
Zdenenk

For the purpose of testing 3.0 the identifiers in Comment 6 *are* implemented in 3.0

Comment 5 gives the state of the trunk implementation of qpid. (from 0.24 onwarsd I think) This is what I expect the 3.1 identifiers to be.

Comment 12 Andrew Stitcher 2015-09-04 18:20:48 UTC
As far as I can tell all the missing special headers have been added into MRG 3.2


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