How Do I Verify that a Message Sent to MSMQ Was Read? (Magic xpa 3.x)
The Microsoft MSMQ object includes a system that allows you to verify if, in fact, the message was received by the message queue.
An MSMQ message has a series of properties defined by Microsoft. The Magic xpa MSMQ component will set these properties for you when it sends the message. All you need to do is to set the property within the component. This is done using the MSMQ External Message Set table.
-
Create a Link Write operation in the Data view.
-
Link on the Property column, using the literal text ‘Ack’, and init the column to the same value.
-
Update the Datatype column to ‘N’.
-
Update the Data column to the acknowledgement code, in string format. Use the Str() function to convert the code to an alpha string, if needed.
There are several different MSMQ acknowledgement codes, which are listed in the Magic xpa Help. In our example we used 14, which posts an acknowledgment in every case: a positive one if it was received within the time limit, and a negative one otherwise.
Next, you need to send the table with all your properties to the component. See How Do I Send the MSMQ External Message Table to a the Message Setup Program? for how to do this.
Now, when the message is posted, MSMQ will post a response, according to the type of acknowledgement you requested, to the administration queue. You will need to read that queue and respond according to what the application needs.