0

Currently I'm building some software with Easynetq (a .net lib ontop of rabbitmq). This works great except for 1 thing.

We have a publish subscribe setup. A server pushes messages to a client that can or cannot be connected. In a unwanted scenario, the client could loose its connection. When the application closes you will do an unsubscribe so then the subscription is gone. But lets say the network connection is down. Is there any way to ensure that those messages are not processed? Or can we purge the messages on the OnConnect event?

4

1 回答 1

0

Use the advanced API:

https://github.com/EasyNetQ/EasyNetQ/wiki/The-Advanced-API

start a consumer on an exclusive queue. The exclusive queue only exists for the lifetime of the connection. When you disconnect the queue, and any messages on it will be deleted.

于 2014-08-24T11:11:17.187 回答