38 lines
2.7 KiB
XML
38 lines
2.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
||
<!-- ============================================================================= -->
|
||
<!-- Copyright © 2009 Red Hat, Inc. and others. -->
|
||
<!-- -->
|
||
<!-- The text of and illustrations in this document are licensed by Red Hat under -->
|
||
<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
|
||
<!-- -->
|
||
<!-- An explanation of CC-BY-SA is available at -->
|
||
<!-- -->
|
||
<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
|
||
<!-- -->
|
||
<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
|
||
<!-- of it, you must provide the URL for the original version. -->
|
||
<!-- -->
|
||
<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
|
||
<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
|
||
<!-- permitted by applicable law. -->
|
||
<!-- ============================================================================= -->
|
||
|
||
<chapter id="wildcard-routing">
|
||
<title>使用通配符实现消息路由</title>
|
||
<para>HornetQ支持使用带通配符的地址对消息路由。</para>
|
||
<para>例如,当创建一个队列时使用了地址<literal>queue.news.#</literal>,那么它就能接收
|
||
所有和这个地址通配符相配的每一个地址的消息。这样的地址如 <literal
|
||
>queue.news.europe</literal> 或 <literal>queue.news.usa</literal> 或 <literal
|
||
>queue.news.usa.sport</literal>等。这样一个消息接收者可以接收<literal>一组</literal>相关
|
||
的地址的消息,而不是只能指定一个具体的地址。</para>
|
||
<note>
|
||
<para>用JMS的术语来说,这个功能就是允许创建“话题组”(topic hierarchy)。</para>
|
||
</note>
|
||
<para>要使用本功能需要将<literal>wild-card-routing-enabled</literal>属性设置为<literal>true</literal>。
|
||
这个属性在 <literal>hornetq-configuration.xml</literal> 文件中。默认值是<literal>true</literal>。</para>
|
||
<para>关于通配符的语法参见<xref
|
||
linkend="wildcard-syntax" /> 章及 <xref
|
||
linkend="topic-hierarchy-example" />。</para>
|
||
</chapter>
|