Red Hat DocumentationFuse Message BrokerToggle FramesPrintFeedback

The QueueMonitor Application

What the sample does

The QueueMonitor moves through a specified set of queues, listing the active messages it finds as it examines each queue. In the examples to this point, the Talk samples left no messages in any queue.

Comparing MessageMonitor and QueueMonitor

The monitor samples each open GUI windows that provide a scrolling array of its contents. The nature of the two monitors underscores fundamental differences between the Publish and Subscribe messaging model and the Point-to-point messaging model. The differences between MessageMonitor and QueueMonitor are as follows:

What messages are displayed?

  • MessageMonitor: Delivered.

  • QueueMonitor: Undelivered.

When does the display update?

  • MessageMonitor: When a message is published to a subscribed topic, it is added to the displayed list.

  • QueueMonitor: When you click the Browse Queues button, the list is refreshed.

When does the message go away?

  • MessageMonitor: When the display is cleared for any reason.

  • QueueMonitor: When the message is delivered (or when it expires).

What happens when the broker and monitor are restarted?

  • MessageMonitor: As messages are listed at the moment they are delivered, there are no messages in the MessageMonitor until new deliveries occur.

  • QueueMonitor: Listed messages marked PERSISTENT are stored in the broker persistent storage mechanism. They are redisplayed when the broker and the QueueMonitor restart and then choose to browse queues.

Starting the sample

To run the QueueMonitor sample do the following:

  1. In window 1, enter ant talk1.

  2. In window 3, enter ant qmonitor.

    The QueueMonitors console window lists the queues that have been specified for it to browse.

    The QueueMonitor Java window opens.

  3. Click Browse Queues.

    The messages in the queue at the moment it is browsed are listed. If you are following along carefully, there should be no messages in any queue.

Putting messages into a queue

To put messages into a queue do the following:

  1. In window 1 (where Talker1 is running), type 1 and then press Enter.

  2. Repeat step 1 to create a few messages, such as 2 Enter, 3 Enter, 4 Enter.

  3. In the QueueBrowser window, click Browse Queues.

    The messages are in the queue. They will continue to be there until a receiver receives them on that queue, or they expire (set to 30 minutes by the sender).

The messages that are waiting on the queue will get delivered to the next receiver that chooses to receive from that queue.

Receiving messages from a queue

To receive the queued messages do the following:

  1. In window 2, enter ant talk2.

  2. When the Talker_2 application opens, it shows that it consumes the messages in the queue in sequence.

  3. In the QueueBrowser window, click Browse Queues.

    The queues are all empty. As long as you have receivers on the sample queues, no messages will display in the QueueMonitor window.

Stopping the sample

To stop all the applications, press Ctrl+C in each of the windows.

Comments powered by Disqus