Message Filtering

Use messagefilter.xml to configure the RAPStore and RAPCache subscribers to automatically filter certain messages.

A rule definition specifies a message type (by its ID, which is set in the template for that message type), whether the rule is an include rule or an exclude rule, and the condition. For include rules, only messages that match the condition are loaded. For exclude rules, messages that match the condition are excluded.

You cannot define both an include rule and an exclude rule for the same message type. However, the same message type can have multiple rules of the same type. These rules are defined by using multiple <Rule> tag blocks in the XML configuration file, as shown in the example below.

Configure message filtering in messagefilter.xml, located in the config directory of the RAPCache and RAPStore subscriber. The file should be identical for both subscribers.

Example

The messagefilter.xml file that ships with RAP does not contain any rules; it contains only the MessageFilter and RuleList tags. This example adds two rules:
  • Exclude message type 4 when Exchange value is NYSE.
  • Include message type 13 when Symbol value is SY.
 <?xml version="1.0" encoding="UTF-8"?>
	<MessageFilter>
		<RuleList>
			<Rule>
				<MessageType>4</MessageType>
				<RuleType>exclude</RuleType>
				<FieldRule>
					<FieldName>Exchange</FieldName>
					<FieldValue>NYSE</FieldValue>
				</FieldRule>
			</Rule>
			<Rule>
				<MessageType>13</MessageType>
				<RuleType>include</RuleType>
				<FieldRule>
					<FieldName>Symbol</FieldName>
					<FieldValue>SY</FieldValue>
				</FieldRule>
			</Rule>
		</RuleList>
</MessageFilter>
Related concepts
Filter Rules