Red Hat DocumentationFuse Message BrokerToggle FramesPrintFeedback

Request and Reply (PTP)

Overview

In the PTP domain, the requestor application can be started and even send a message before the replier application is started. The queue holds the message until the replier is available. The requestor is still blocked, but when the replier's message listener receives the message, it releases the blocked requestor. The sample code includes an option (-m) to switch the mode between uppercase and lowercase.

Running the sample

To run the PTP Request and Reply sessions do the following:

  1. In window 1, enter: ant qrequest.

  2. In window 2, enter: ant qreply.

  3. In the Requestor window, type AaBbCc then press Enter.

    The Replier window reflects the activity, displaying:

    [Request] RequestingTalker:
                                AaBbCc

    The replier completes its operation (converts text to uppercase) and sends the result in a message to the requestor. The requestor gets the reply from the replier:

    [Reply] Transformed RequestingTalker: AaBbCc to all uppercase: REQUESTINGTALKER: AABBCC

Stopping the sample

To stop the applications press Ctrl+C in each window.

Comments powered by Disqus