Using the MSMQ Service

Microsoft Message Queuing (MSMQ) is a messaging protocol that allows applications running on separate servers/processes to communicate by sending text or messages to queues and reading text or messages from queues. The text or messages are delivered even when these systems may be temporarily offline as MSMQ resends the text or messages in the queue once the destination is reachable.

You can use Real-Time Client to configure an MSMQ service that sends (and receives) text or messages to (or from) an MSMQ queue. A message requires the definition of a custom type (for customized solutions).

This section describes how to:

Add an MSMQ client service representing a VIP queue

Add rules that receive text from this queue (either synchronously or asynchronously)

Add a rule that sends text to this queue

In this example, the event handler is configured to recognize when text is received from the queue (and to assign the text to the MSMQ Received Text parameter). An event is also configured that is triggered when text is sent to the queue.

To use the MSMQ Service:

1. In the Physical Objects tab, in the Services tab, add a new service with Service Type equal to MSMQ Client.

2. Under VIP Queue, select Path and specify the path name of the queue. The path name of a queue provides the information Message Queuing needs to access the queue. To read more about the path name syntax, refer to https://msdn.microsoft.com/en-us/library/ms706083(v=vs.85).aspx.

3. In the Business Logic tab, in the Rules tab, add a Sync receive rule to receive a message from the queue synchronously.
4. In the Rule Editor, add a condition to define when to turn the rule on.

This example assumes that you have added a User Type named VIP and a Property named FFNo in the Business Entities tab, and created an instance of the user type.

5. To add the instruction to execute when the rule turns on, insert the following:

Assign Receive text of VIP Queue True into Text

6. Add an Async receive rule to receive a message from the queue asynchronously.
7. In the Rule Editor, add a condition to define when to turn the rule on.
8. To add the instruction to execute when the rule turns on, insert the following:

Receive text of VIP Queue True

9. Add a Send rule to send a message to the queue.
10. In the Rule Editor, add a condition to define when to turn the rule on.
11. To add the instruction to execute when the rule turns on, insert the following:

Send of VIP Queue Hello World

12. In the Business Logic tab, in the Event Handlers tab, add a new event handler named Text Received.
13. In the Properties, select VIP Queue is Text Received for when the event is raised.
14. To add the instruction to execute when the event is triggered, insert the following:

Assign MSMQ Received Text into Text