검색

이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 5. Message Addresses and Queues

download PDF

AMQ 7 introduces a new, flexible addressing model that enables you to define standard messaging patterns that work for any messaging protocol. Therefore, the process for configuring queues and topic-like behavior has changed significantly.

5.1. Addressing Changes

AMQ 6 implemented JMS concepts such as queues, topics, and durable subscriptions as directly-configurable destinations.

Example: Default Queue and Topic Configuration in AMQ 6

<destinations>
     <queue physicalName="my-queue" />
     <topic physicalName="my-topic" />
</destinations>

AMQ Broker 7 uses addresses, routing types, and queues to achieve queue and topic-like behavior. An address represents a messaging endpoint. Queues are associated with addresses. A routing type defines how messages are distributed to the queues associated with an address. There are two routing types: Anycast distributes messages to a single queue within the matching address, and Multicast distributes messages to every queue associated with the address.

By associating queues with addresses and routing types, you can implement a variety of messaging patterns, such as point-to-point (queues) and publish-subscribe (topic-like).

Example: Point-to-Point Address Configuration in AMQ Broker 7

In this example, when the broker receives a message on address.foo, the message will be routed to my-queue. If multiple anycast queues are associated with the address, the messages are distributed evenly across the queues.

<address name="address.foo">
  <anycast>
    <queue name="my-queue"/>
  </anycast>
</address>

Example: Publish-Subscribe Address Configuration in AMQ Broker 7

In this example, when the broker receives a message on topic.foo, a copy of the message will be routed to both my-topic-1 and my-topic-2.

<address name="topic.foo">
  <multicast>
    <queue name="my-topic-1"/>
    <queue name="my-topic-2"/>
  </multicast>
</address>

Related Information

5.2. How Addressing is Configured

You use the BROKER_INSTANCE_DIR/etc/broker.xml configuration file to configure addresses and queues for your broker instance.

The broker.xml configuration file contains the following default addressing configuration in the <addresses> section. There are default entries for the Dead Letter Queue (DLQ) and Expiry Queue (ExpiryQueue):

<addresses>
   <address name="DLQ">
      <anycast>
         <queue name="DLQ" />
      </anycast>
   </address>
      <address name="ExpiryQueue">
         <anycast>
            <queue name="ExpiryQueue" />
         </anycast>
   </address>
</addresses>

You can configure addressing for your broker instance by using any of the following methods:

MethodDescription

Manually configure an address

You define the routing types and queues that the broker should use when receiving a message on the address. You can configure an address in the following ways:

Configure the broker to create addresses automatically

You specify an address prefix and routing type for which addresses you want to be created automatically. When the broker receives a message on an address that matches the prefix, the address and routing type will be created automatically. You can also specify that the address be deleted automatically when all of its queues have been deleted, and that its queues be deleted automatically when they have no consumers or messages.

For more information, see Configuring automatic creation and deletion of addresses and queues in Configuring AMQ Broker.

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.