I have 2 windows services in C#. Service 1 publishes messages to the RabbitMQ queue. Service 2 subscribes the RabbitMQ queue. Service 2 also connects to a TCP server and sends the messages it has received from RabbitMQ to this server. My question is, is there any way to stop Service 1 from publishing messages on to the queue when Service 2 which consumes this message has failed out due to some error (Mostly, SocketException if it cannot connect to the Server). Any pointer would be really helpful. Please let me know if any more information is required.
Thanks in Advance.