Integration / ActiveMQ Interview Questions Intermediate
When should you use a Durable Subscriber over a plain consumer?
Use a durable subscriber when the receiver is a Topic subscriber that must never miss messages published while it's offline - for example, an audit trail, a billing reconciliation job, or a cache-warming service that must reflect every event even after a restart or network blip.
A plain, non-durable topic subscriber only gets what's published while it's actively connected, so any gap in connectivity means a permanent gap in its view of the stream. The trade-off is that the broker must retain unacknowledged messages for a durable subscriber indefinitely, or until a configured expiry, consuming storage even while the subscriber is offline. That's why it isn't the default choice for every topic consumer - only for ones where completeness matters more than storage overhead.
It's worth contrasting this with Virtual Topics, which achieve similar no-message-loss guarantees for multiple consumer groups without the per-client durable subscription bookkeeping - durable subscribers remain the right tool specifically when you need classic JMS topic semantics, such as selectors scoped to one named subscription.
More Related questions...