Is it possible to mirror a single queue in ActiveMQ?
activemq-classic, message-queue
Solution
You can mirror single queues like this:
<destinationInterceptors>
<virtualDestinationInterceptor>
<virtualDestinations>
<compositeQueue name="YOUR.QUEUE" forwardOnly="false">
<forwardTo>
<queue physicalName="MIRROR.OF.YOUR.QUEUE"/>
</forwardTo>
</compositeQueue>
</virtualDestinations>
</virtualDestinationInterceptor>
</destinationInterceptors>
You can find the documentation for virtual destinations here.
Problem
I'm running ActiveMQ in a production system. Some of our queues are very high volume and some are very low volume. I'm interested in mirroring one of the low volume queues so that I can build informal monitoring services around the messages being received. Unfortunately, the only documentation I've been able to find seems to imply that Mirrored Queues are are all-or-nothing: you either create a topic for every single queue you have (and suffer the performance penalty of copying every message flowing through your system), or you can't use the feature at all. Is there no way of enabling this helpful functionality for a single, known queue name?