Receiving Results C# Help

With the current version of the sample; ever dealt with. To get results from the, application the sending application never knows if the message is ever, acknowledgment queues or response queues can be used.

Acknowledgment Queues

With an acknowledgment queue, the sending application can get information about the status of the message. With the acknowledgments, you can define if you would like to receive an answer, if everything went OK, or if something went wrong. For example, acknowledgments can be sent when the message reaches the destination queue or when the message is read, or if it didn’t reach the ‘destination queue or was not read before a timeout elapsed.

In the example, the AdministrationQueue of the Message class is set to the CourseOrderAck queue. This queue must be created similar to a normal queue. This queue is just used the other way around: the original sender receives acknowledgments. The AcknowledgeType property is set to AcknowledgeTypes. FullReceive to get an acknowledgment when the message is read:

Capture

Instead of using acknowledgments, the dead-letter queue can be used for messages that didn’t arrive at their destination. By setting the Use Dead Letter Queue property of the Message class to true, the message is copied to the dead-letter queue if it didn’t arrive at the target queue before the timeout was reached.

Timeouts can be set with the Message properties Time To Reach Queue and Time To Be Received.

Response Queues

If more information than an acknowledgment is needed from the receiving application, a response queue can be used. A response queue is like a normal queue, but the original sender uses the queue as a receiver and the original receiver uses the response queue as a sender.

The sender must assign the response queue with the Response Queue property of the Message class. The sample code here shows how the receiver uses the response queue to return a response message. With the response message response Message, the property CorrelationId is set to the ID of the original message. This way the client application knows to which message the answer belongs. This is similar to acknowledgment queues. The response message is sent with the Send() method of the Message Queue object that is returned from the Response Queue property:

Capture

Posted on November 2, 2015 in Message Queuing

Share the Story

Back to Top