activemq-artemis/docs/user-manual/en/jms-core-mapping.xml

52 lines
3.8 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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 AttributionShare 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. -->
<!-- ============================================================================= -->
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "HornetQ_User_Manual.ent">
%BOOK_ENTITIES;
]>
<chapter id="jms-core-mapping">
<title>Mapping JMS Concepts to the Core API</title>
<para>This chapter describes how JMS destinations are mapped to HornetQ addresses.</para>
<para>HornetQ core is JMS-agnostic. It does not have any concept of a JMS topic. A JMS topic is
implemented in core as an address (the topic name) with zero or more queues bound to it.
Each queue bound to that address represents a topic subscription. Likewise, a JMS queue is
implemented as an address (the JMS queue name) with one single queue bound to it which
represents the JMS queue.</para>
<para>By convention, all JMS queues map to core queues where the core queue name has the string
<literal>jms.queue.</literal> prepended to it. E.g. the JMS queue with the name
"orders.europe" would map to the core queue with the name "jms.queue.orders.europe". The
address at which the core queue is bound is also given by the core queue name.</para>
<para>For JMS topics the address at which the queues that represent the subscriptions are bound
is given by prepending the string "jms.topic." to the name of the JMS topic. E.g. the JMS
topic with name "news.europe" would map to the core address "jms.topic.news.europe"</para>
<para>In other words if you send a JMS message to a JMS queue with name "orders.europe" it will
get routed on the server to any core queues bound to the address "jms.queue.orders.europe".
If you send a JMS message to a JMS topic with name "news.europe" it will get routed on the
server to any core queues bound to the address "jms.topic.news.europe".</para>
<para>If you want to configure settings for a JMS Queue with the name "orders.europe", you need
to configure the corresponding core queue "jms.queue.orders.europe":</para>
<programlisting>
&lt;!-- expired messages in JMS Queue "orders.europe" will be sent to the JMS Queue "expiry.europe" -->
&lt;address-setting match="jms.queue.orders.europe">
&lt;expiry-address>jms.queue.expiry.europe&lt;/expiry-address>
...
&lt;/address-setting></programlisting>
</chapter>