How to send message to remote queue without saving messages in outgoing queue while remote machine is not connected?
I have a remote mac开发者_如何转开发hine that has a private queue and the server sends these messages to the remote queue. This is working fine. The issue is when the remote machine is not connected to network or turned off, the messages are saved in outgoing queue of the server and delivered later on when remote machine comes online. Now my requirement is that if the message is not delivered the server should know. And in the current case there is no exception is thrown as its saved in outgoing queue.
Now I have three things in mind.
- The outgoing queue should not save the message.
- Some acknowledgement should be returned from remote machine.
- I should post message directly by queue url as its hosted under IIS.
I would like to go with solution 3 but not finding any resouces over the topic.
Look at setting a receive timeout on your message and using dead letter queues. When the remote server doesn't read the message in the timeout specified the message will be moved to the dead letter queue. You can monitor the dead letter queue to know when message were not received by the remote server.
精彩评论