A message selector is a string that lets a client program specify a set of messages, based on the values of message headers and properties. A selector matches a message if, after substituting header and property values from the message into the selector string, the string evaluates to
true. Consumers can request that the server deliver only those messages that match a selector.
Certain names are exceptions, which cannot be used as identifiers. In particular, NULL,
TRUE,
FALSE,
NOT,
AND,
OR,
BETWEEN,
LIKE,
IN,
IS, and
ESCAPE are defined to have special meaning in message selector syntax.
A string literal is enclosed in single quotes. To represent a single quote within a literal, use two single quotes; for example, 'literal''s'. String literals use the Unicode character encoding. String literals are case sensitive. The server has a limit of 32,767 string literals in a selector string.
An approximate numeric literal is a numeric value with a decimal point (such as 7.,
-95.7, and
+6.2), or a numeric value in scientific notation (such as
7E3 and
-57.9E2); numbers in the range of
double are supported. Approximate literals use the floating-point literal syntax of the Java programming language.
Every selector is a conditional expression. A selector that evaluates to true matches the message; a selector that evaluates to
false or unknown does not match.
Comparison of string values is restricted to = and
<>. Two strings are equal if and only if they contain the same sequence of characters.
The BETWEEN comparison operator includes its endpoints. For example:
The identifier must evaluate to either a string or
NULL. If it is
NULL, then the value of this expression is unknown. You can use a maximum of 32,767 string-literals in the string set.
The identifier must evaluate to a string.
The pattern-value is a string literal, in which some characters bear special meaning: