-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9494/
-----------------------------------------------------------

Review request for qpid, Gordon Sim and Kenneth Giusti.


Description
-------

This is a potential first cut at JMS style selectors for the c++ broker and 
client.

Currently what's implemented:

Selector parser/evaluator:
Parse a subset of the selector language including:
Conditional expressions : "=" "<>" "IS NULL" "IS NOT NULL" "NOT "AND" "OR"
All values are treated as strings (no numerics or boolean literals) so there 
are no numeric
operators or comparison operators (strings can only be compared for equality)
"LIKE" & "NOT LIKE", "IN" are not (yet) supported.

To specify a selector you add a link property called qpid.selector to a queue 
type address, for example:

queue; {link:{qpid.selector:"amqp.delivery_mode='PERSISTENT' or not 
TransactionType='red'"}}

The code is currently implemented in the 0-10 code paths of the broker and the 
messaging library:
The selector is sent from client to broker as an argument property in the 
message subscription.

Still to do:
* amqp 1.0 support.
* Improved "special" identifier handling - currently not all the amqp.* 
identifiers are handled and
  we may need some extra message hooks to get the rest uniformly across 0-10 
and 1.0 messages.

* Work on parser/evaluator:
** Handle type other than string
** Booleans
** Numerics
** Numeric operators and comparisons
** more complex operators:
*** string: "LIKE", "NOT LIKE", "IN"
*** numeric: "BETWEEN"

Having said all that needs still to be done, I'm reasonably happy that what's 
currently there is useful and stable so could go into the tree is currently is.


This addresses bug QPID-4558.
    https://issues.apache.org/jira/browse/QPID-4558


Diffs
-----

  /trunk/qpid/cpp/src/CMakeLists.txt 1446233 
  /trunk/qpid/cpp/src/Makefile.am 1446233 
  /trunk/qpid/cpp/src/qpid/broker/Selector.h PRE-CREATION 
  /trunk/qpid/cpp/src/qpid/broker/Selector.cpp PRE-CREATION 
  /trunk/qpid/cpp/src/qpid/broker/SelectorExpression.h PRE-CREATION 
  /trunk/qpid/cpp/src/qpid/broker/SelectorExpression.cpp PRE-CREATION 
  /trunk/qpid/cpp/src/qpid/broker/SelectorToken.h PRE-CREATION 
  /trunk/qpid/cpp/src/qpid/broker/SelectorToken.cpp PRE-CREATION 
  /trunk/qpid/cpp/src/qpid/broker/SemanticState.h 1446233 
  /trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp 1446233 
  /trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp 1446233 
  /trunk/qpid/cpp/src/tests/CMakeLists.txt 1446233 
  /trunk/qpid/cpp/src/tests/Makefile.am 1446233 
  /trunk/qpid/cpp/src/tests/Selector.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/9494/diff/


Testing
-------

Selector parser/evaluator tested reasonably thoroughly using new unit tests.

Current make check still works.

Informally tested selector functionality using qpid-send, qpid-receive.


Thanks,

Andrew Stitcher

Reply via email to