Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught basicReturn #50

Open
acacio opened this issue Nov 10, 2011 · 0 comments
Open

Uncaught basicReturn #50

acacio opened this issue Nov 10, 2011 · 0 comments

Comments

@acacio
Copy link

acacio commented Nov 10, 2011

I'm writing a small test and, when there are no subscribers in the exchange while using mandatory delivery mode, I get an an uncaught exception, despite me catching that event.

Code snippets

var msgDeliveryOptions = {
    mandatory: true,
    deliveryMode: 2          // persistent = 2, non-persistent = 1
};

var exchange = connection.exchange('acacio.topic', null, function(e) { util.puts(e.name); });
exchange.publish('test', msg, msgDeliveryOptions);
exchange.on('basicReturn', exchangeError);

function exchangeError(err) {
  util.puts(JSON.stringify(err, null, 2));
  util.puts('I got it!');
}

OUTPUT:

{
  "replyCode": 312,
  "replyText": "NO_ROUTE",
  "exchange": "acacio.topic",
  "routingKey": "test"
}
I got it!
Warning: Uncaught basicReturn: {"replyCode":312,"replyText":"NO_ROUTE","exchange":"acacio.topic","routingKey":"test"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant