Appendix A. Using a Message Selector

A client only receive the messages that meet the filtering condition specified in the message selector. A message selector filters the messages received in the destination to only receive those that meet the specified condition. It compares the properties specified in a message and the condition specified in the message selector. Only the properties can be compared but not the values of the body which stores the main contents.

The syntax of a message selector complies with a part of the SQL92 expression. A message selector is evaluated in the order of left to right. The order can be changed using parenthesis. It consists of literals, identifiers, and expressions.

Example

The following is an example of using a message selector.

"Type = 'cat' AND Weight BETWEEN 5 AND 15"

If both Type = 'cat' and Weight BETWEEN 5 AND 15 ("weight >= 5 and weight <= 15") are true, the above statement is true.