[
https://issues.apache.org/jira/browse/AMQ-3097?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary Tully resolved AMQ-3097.
-----------------------------
Resolution: Fixed
Fix Version/s: 5.9.0
Assignee: Gary Tully
patch applied with thanks in http://svn.apache.org/r1478973
added some unit test to validate and demonstrate.
From:
http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/selector/SelectorTest.java?view=diff&r1=1478972&r2=1478973&pathrev=1478973
it is possible to see some examples:{code}
assertSelector(message, "REGEX('1870414179', SessionserverId)", false);
message.setLongProperty("SessionserverId", 1870414179);
assertSelector(message, "REGEX('1870414179', SessionserverId)", true);
assertSelector(message, "REGEX('[0-9]*', SessionserverId)", true);
assertSelector(message, "REGEX('^[1-8]*$', SessionserverId)", false);
assertSelector(message, "REGEX('^[1-8]*$', SessionserverId)", false);
assertSelector(message, "INLIST(SPLIT('Tom,Dick,George',','), name)",
false);
assertSelector(message, "INLIST(SPLIT('Tom,James,George',','), name)",
true);
assertSelector(message, "INLIST(MAKELIST('Tom','Dick','George'),
name)", false);
assertSelector(message, "INLIST(MAKELIST('Tom','James','George'),
name)", true);
assertSelector(message, "REGEX('connection1111',
REPLACE(JMSMessageID,':',''))", true);{code}
> add Function calls to selectors
> -------------------------------
>
> Key: AMQ-3097
> URL: https://issues.apache.org/jira/browse/AMQ-3097
> Project: ActiveMQ
> Issue Type: New Feature
> Components: Selector
> Affects Versions: 5.4.2
> Environment: n/a
> Reporter: Arthur Naseef
> Assignee: Gary Tully
> Priority: Minor
> Fix For: 5.9.0
>
> Attachments: selectorFunctions.patch
>
>
> As described in the Nabble thread, "custom selector / filter for messages", I
> have implemented message call support in selectors, together with a few
> initial functions and the ability to register new functions without modifying
> the core.
> Attached is a patch that implements this feature.
> There are no unit tests currently implemented, but I can provide them in the
> near future if needed.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira