Overview

Chapter 11. ActiveMQ broker features in action

ActiveMQ’s broker can be pushed well beyond basic point-to-point and publish/subscribe messaging by using several advanced features together. The chapter introduces ways to make applications more flexible and easier to manage, focusing on broker-side tools that help route messages, observe broker activity, improve delivery semantics, and extend behavior through configuration. It frames these capabilities as practical building blocks for more robust enterprise messaging systems.

One major theme is broader message routing and broker awareness. Wildcards let a consumer subscribe to a hierarchy of destinations with a single subscription, while composite destinations let a producer send the same message to multiple queues and topics in one operation. The broker also emits advisory messages that report on connections, consumers, producers, destinations, expiration, limits, and dead-letter activity, giving applications and administrators a way to react to changes in broker state without relying only on external monitoring tools.

The chapter also shows how ActiveMQ blends reliability and scalability features with higher-level extensions. Virtual topics combine topic-style broadcasting with queue-style load balancing and failover, retroactive consumers allow late subscribers to recover recent topic messages without full persistence, and dead-letter queues capture expired or undeliverable messages for later inspection. It then demonstrates broker plug-ins for visualization, logging, timestamp correction, and statistics collection, before ending with Apache Camel integration as a lightweight routing engine that can be embedded into ActiveMQ to move, transform, and periodically republish messages in powerful ways.

ActiveMQ virtual topics feed queues from topic messages
Active destinations for an ActiveMQ broker graphically generated by the destinationDotFilePlugin

FAQ

What are wildcards in ActiveMQ destination names used for?Wildcards let a consumer subscribe to multiple destinations using a single destination pattern. ActiveMQ supports dot-separated destination hierarchies, and the special characters * and > can match one element or one-or-more trailing elements, respectively.
How do ActiveMQ destination wildcards work?ActiveMQ uses hierarchical destination names separated by dots. The * wildcard matches exactly one level in the hierarchy, while > matches one or all trailing levels. For example, *.*.Leeds matches any sport and league ending in Leeds.
Can wildcards be used to publish messages to multiple destinations?No. Wildcards are for consumers, not producers. If you publish to a wildcard-like destination, the message is sent only to that exact destination name. To send one message to multiple destinations, use a composite destination.
What is a composite destination in ActiveMQ?A composite destination is a comma-separated destination name that sends the same message to multiple queues or topics in one send operation. It can also mix queues and topics, such as sending to both queue:// and topic:// destinations at once.
What are advisory messages in ActiveMQ?Advisory messages are system-generated JMS notification messages that report broker activity such as connections, producers, consumers, destinations, and system-limit warnings. They are published on predefined advisory topics and can be used for asynchronous monitoring.
How can you listen for connection advisory messages?You subscribe to the advisory topic defined in AdvisorySupport.CONNECTION_ADVISORY_TOPIC and inspect the advisory payload. A ConnectionInfo indicates a connection started, while a RemoveInfo indicates a connection stopped.
What is a virtual topic in ActiveMQ?A virtual topic combines topic publishing with queue-style consumption. Producers send to a topic named VirtualTopic.<name>, and consumers read from queues named Consumer.<consumer name>.VirtualTopic.<name>, giving load balancing and failover with topic-like broadcasting.
What are retroactive consumers in ActiveMQ?Retroactive consumers can receive a limited backlog of past topic messages without requiring full message persistence. Consumers mark themselves as retroactive, and the broker caches a configurable amount of recent messages using a subscription recovery policy.
When do messages go to a dead-letter queue?Messages go to a dead-letter queue when they expire or when they cannot be redelivered after the configured number of attempts. ActiveMQ can use a default DLQ or an individual dead-letter strategy for specific destinations.
How can Apache Camel be used with ActiveMQ broker features?Apache Camel can be embedded in ActiveMQ to define routing rules that move messages between destinations. For example, Camel can route messages from a topic to a queue, or periodically request broker statistics and publish them to another topic.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • ActiveMQ in Action ActiveMQ in Action ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • ActiveMQ in Action ActiveMQ in Action ebook for free