Virtual Topics vs just using Queues in ActiveMQ Classic

  Kiến thức lập trình

I have not been able to find answers in the documentation for these questions. Specifically asking in regard to ActiveMQ 5.16.x:

  • Is it possible to set up virtual topics such that a producer can produce messages to it first, and the subsequent subscriptions can still read those messages? This feels like an anti-pattern, but since virtual topics sit are backed by durable queues anyway, I was wondering if it were reasonably achievable (though in that case why not just use queues directly?).

  • For my virtual topics, I currently have each subscription create a new queue with a shared subscription name.

    • Where I find out if/how ActiveMQ cleans these queues up after this subscription is closed? I would like some assurance that the queues are not being orphaned.
    • The benefit of using virtual topics instead of just simply queues seems primarily only to be the preservation of topic semantics? If my desire is adopt a produce messages first and then consume without missing messages, it would seem queues are preferred over topics.
  • Does ActiveMQ actually enforce unique queue/topic names? It seems that a call to session.createQueue or session.createTopic with a given name will retrieve an already existing entity if there is one?

LEAVE A COMMENT