blob: ff30762b0059f812ac630852fe4e3921eeb02ee9 [file] [log] [blame]
<div class="wiki-content maincontent"><p>We support destination wildcards to provide easy support for federated name hierarchies. This concept has been popular in financial market data for some time as a way of organizing events (such as price changes) into hierarchies and to use wildcards for easy subscription of the range of information you're interested in.</p><p>For example imagine you are sending price messages from a stock exchange feed. You might use some kind of destination such as</p><ul><li><code>PRICE.STOCK.NASDAQ.ORCL</code> to publish Oracle Corporation's price on NASDAQ and</li><li><code>PRICE.STOCK.NYSE.IBM</code> to publish IBM's price on the New York Stock Exchange</li></ul><p>A subscriber could then use exact destinations to subscribe to exactly the prices it requires. Or it could use wildcards to define hierarchical pattern matches to the destinations to subscribe from.</p><h3>Wildcards supported</h3><p>We support the following wildcards which are fairly standard practice; wildcards are not part of the JMS specification so are custom enhancements.</p><ul><li><code>.</code> is used to separate names in a path</li><li><code>*</code> is used to match any name in a path</li><li><code>&gt;</code> is used to recursively match any destination starting from this name</li></ul><p>For example using the example above, these subscriptions are possible</p><table><tbody><tr><th colspan="1" rowspan="1"><p>Subscription</p></th><th colspan="1" rowspan="1"><p>Meaning</p></th></tr><tr><td colspan="1" rowspan="1"><p><code>PRICE.&gt;</code></p></td><td colspan="1" rowspan="1"><p>Any price for any product on any exchange</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>PRICE.STOCK.&gt;</code></p></td><td colspan="1" rowspan="1"><p>Any price for a stock on any exchange</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>PRICE.STOCK.NASDAQ.*</code></p></td><td colspan="1" rowspan="1"><p>Any stock price on NASDAQ</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>PRICE.STOCK.*.IBM</code></p></td><td colspan="1" rowspan="1"><p>Any IBM stock price on any exchange</p></td></tr></tbody></table><p><strong>Note:</strong> Don't specify any string after '&gt;' on your wildcard expression, it will be ignored. E.g. using a wildcard <code>PRICE.&gt;.IBM</code> will also match <code>PRICE.STOCK.NASDAQ.FB.</code> Using '&gt;' really matches everything till the end of the destination name.</p><h3>Custom path separator</h3><p>As of version 5.5.0 we support <a shape="rect" href="http://activemq.apache.org/interceptors.html">plugin</a> that allows clients to use customer path separator. So instead of</p><p><code>FOO.BAR.*</code></p><p>you can use</p><p><code>FOO/BAR/*</code></p><p>To</p><structured-macro ac:macro-id="6486674f-1532-4de3-b3c2-c695c716cbb6" ac:name="code" ac:schema-version="1"><plain-text-body> &lt;plugins&gt;
.....
&lt;destinationPathSeparatorPlugin/&gt;
&lt;/plugins&gt;
</plain-text-body></structured-macro><p>Please note that you should add this plugin as last if you want it to work properly with other plugins (such as <a shape="rect" href="http://activemq.apache.org/security.html">security</a> for example).</p><p>A default path separator this plugin will use is <code>/</code>. You can customize it further using <code>pathSeparator</code> property.</p></div>