How to use mirrored queues?

Solution Verified - Updated -

Environment

  • Fuse Message Broker all versions

Issue

How to use mirrored queues?

What are mirrored queues?

Resolution

A mirrored queue acts like a WireTap EIP in the sense that all messages sent to that queue are also published to a topic. Subscribers to that topic then receive a copy of all messages.
E.g. if a producer sends messages to a queue named Foo.Bar which is configured to be a mirrored queue, then a topic subscriber can connect to the topic VirtualTopic.Mirror.Foo.Bar and receive copies of every messages being sent to the queue Foo.Bar.

The idea of mirrored queues is to provide a way to monitor every message coming into a queue without actually impacting the message flow. This could also be achieved by browsing with the difference that browsing a queue will not create copies of the messages being browsed. Also, once a message is mirrored if no publishers are subscribed to the mirror the message is lost.

To enable mirror queues simply add the following entry to the broker config:

<destinationInterceptors>
  <mirroredQueue copyMessage = "true" postfix=".qmirror" prefix=""/>
</destinationInterceptors>

With this entry every queue will have a mirror topic with the postfix ".qmirror".

Also see the Mirrored Queues documentation at Apache.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments