-
1. Re: Is there a way for us to create a subscription based on an IN clause like filter?
jbertram Apr 25, 2012 4:26 PM (in response to connie.yang)The documentation states:
HornetQ provides a powerful filter language based on a subset of the SQL 92 expression syntax.
It is the same as the syntax used for JMS selectors, but the predefined identifiers are different. For documentation on JMS selector syntax please the JMS javadoc for javax.jms.Message.
The javax.jms.Message JavaDoc states:
A selector can contain:
...
identifier [NOT] IN (string-literal1, string-literal2,...)
(comparison operator whereidentifier
has aString
orNULL
value)"Country IN (' UK', 'US', 'France')"
is true for'UK'
and false for'Peru'
; it is equivalent to the expression"(Country = ' UK') OR (Country = ' US') OR (Country = ' France')"
"Country NOT IN (' UK', 'US', 'France')"
is false for'UK'
and true for'Peru'
; it is equivalent to the expression"NOT ((Country = ' UK') OR (Country = ' US') OR (Country = ' France'))"
- If identifier of an
IN
orNOT IN
operation isNULL
, the value of the operation is unknown.
Therefore an "IN" clause should work.
-
2. Re: Is there a way for us to create a subscription based on an IN clause like filter?
connie.yang Apr 25, 2012 4:12 PM (in response to jbertram)Thanks for your reply!
Are you aware of any performance metrics/concern if the IN clause contains 1 million elements?
-
3. Re: Is there a way for us to create a subscription based on an IN clause like filter?
jbertram Apr 25, 2012 4:28 PM (in response to connie.yang)No, I am not aware of any performance metrics involving an IN clause which contains 1 million elements. Give it a try and let us know how it goes.
-
4. Re: Is there a way for us to create a subscription based on an IN clause like filter?
noky Apr 26, 2012 9:47 AM (in response to jbertram)Actually, there is an issue with large selectors like this. I reported a bug in 2010, selector strings over 4096 characters fail:
https://issues.jboss.org/browse/HORNETQ-545
Any chance of getting this fixed?
-
5. Re: Is there a way for us to create a subscription based on an IN clause like filter?
jbertram Apr 27, 2012 11:49 AM (in response to noky)It's fixed now. It will be available in the next release.
-
6. Re: Is there a way for us to create a subscription based on an IN clause like filter?
connie.yang Apr 27, 2012 12:17 PM (in response to jbertram)Great! With the fix, what's the maximum number of selector we can have without causing an issue?
Also, which release will this fix be available?
-
7. Re: Is there a way for us to create a subscription based on an IN clause like filter?
clebert.suconic Apr 27, 2012 2:19 PM (in response to connie.yang)Creating selectors on durable subscriptions shouldn't be an issue... however if you have a really huge queue on create a Consumer on a queue, then you will be doing a scan loop for the selector that can be somewhat unperformant. (if you use too many scans like these)