c# - How to know if a message was not delivered from stomp using rabbitmq? -


i'm using rabbitmq c# , stomp.

when message not delivered consumer because it's down, can use basicreturn command broker sends handle mistake in c#.

public void publish(string message)     {         var body = encoding.utf8.getbytes(message);          channel.basicreturn += (sender, e) => basicreturn(sender, e);           channel.basicpublish(exchange: topic_name,                              routingkey: getagenttosend(),                              mandatory: true,                              basicproperties: null,                              body: body);          console.writeline(" [x] sent {0}", message);     }      private void basicreturn(object sender, rabbitmq.client.events.basicreturneventargs e)     {         console.writeline(e);         var message = encoding.utf8.getstring(e.body);         var routingkey = e.routingkey;         appendtext(string.format("not delivered: agent: [ {0} ] message: [ {0} ] ", routingkey, message));     } 

is there way of handling events in stomp? i've been seaching while, couldn't fine helps.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -