[rabbitmq-discuss] BasicReturn event question

ku3ia demesg at gmail.com
Mon Oct 21 19:23:23 BST 2013

Please advise! I'm using dotnet client library to connect to RabbitMQ server.
Also I'm using BasicReturn event to catch un-routable messages. When I
publish a message via BasicPublish with empty routing key or key, which
doesn't use at any combination with exchange, I catch an event at
BasirReturnEvent Handler. Its ok. But my question is can I catch exception
in try-catch module? For example:

IConnection connection = ...
IModel channel = ...
channel.BasicReturn += BasicReturnVoid;

IBasicProperties properties = ...

try {
  channel.BasicPublish(exchange, key, true, properties, message);
catch (Exception e) 
  // can catch NO ROUTE and other exceptions here???

public static void BasicReturnVoid(IModel channel, BasicNackEventArgs args)
  // normally NO_ROUTE exception catches here


View this message in context: http://rabbitmq.1065348.n5.nabble.com/BasicReturn-event-question-tp30680.html
Sent from the RabbitMQ mailing list archive at Nabble.com.

More information about the rabbitmq-discuss mailing list