Skip to main content

Addresses

An address names a node in the broker, and the capability a receiver asks for decides whether its receivers share a queue or each get a copy.

Three ways receivers meet an address: competing for one queue, a subscription queue each, and a node the broker createsAddress orders: anycastAddress events: multicastDynamic sourceQueue orderseach message onceReceiver 1capability queueReceiver 2capability queueSubscription queueof receiver 1Subscription queueof receiver 2Receiver 1capability topicReceiver 2capability topicReceiverdynamic = trueTemporary queuenamed by the broker
The diagram as text
  1. Address orders: anycast: Queue orders each message once
  2. Address events: multicast: Subscription queue of receiver 1; Subscription queue of receiver 2
  3. Dynamic source: Receiver dynamic = true; Temporary queue named by the broker
  4. Queue orders each message once → Receiver 1 capability queue: message 1
  5. Queue orders each message once → Receiver 2 capability queue: message 2
  6. Subscription queue of receiver 1 → Receiver 1 capability topic: every message
  7. Subscription queue of receiver 2 → Receiver 2 capability topic: every message
  8. Receiver dynamic = true → Temporary queue named by the broker: attach
  9. Temporary queue named by the broker → Receiver dynamic = true: address

A receiver attaches with a source terminus: the address of a node and a list of capabilities. AmqpAddress::queue asks for the capability queue, AmqpAddress::topic for topic, and AmqpAddress::raw for none.

ActiveMQ Artemis reads the capability. With queue, the receivers of an address attach to one anycast queue and compete: each message goes to one of them. With topic, the address is multicast and Artemis gives each receiver a subscription queue of its own, so each receives every message. Artemis creates an address and its queues on the first attach unless its settings forbid it, and orders::billing names one queue of an address directly.

A topic subscription keeps the terminus defaults of the specification: not durable, and expiring with its session. Its subscription queue lives as long as the link, so what is published to the topic while the service is stopped is not kept for it.

A raw address reaches the broker exactly as written, and the broker's own configuration decides what it is. Other brokers address their nodes in their own way: RabbitMQ 4 names a queue /queues/orders and an exchange /exchanges/events/key, and the queue must exist beforehand. Azure Service Bus names a queue by its name and a topic subscription events/subscriptions/billing.

A receiver may ask for a dynamic source instead of naming one. The broker then creates a node, Artemis a temporary queue, and returns its address in its answer to the attach. request attaches one such receiver for every request, sends the address in reply-to, and detaches the receiver when the reply has arrived or the timeout has passed.

The terminus fields are the specification's (messaging, section 3.5), and the address model is Artemis's (AMQP, address model).