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

addExchange defaults to durable true - docs are wrong #194

Open
justintime4tea opened this issue May 23, 2019 · 0 comments
Open

addExchange defaults to durable true - docs are wrong #194

justintime4tea opened this issue May 23, 2019 · 0 comments

Comments

@justintime4tea
Copy link

justintime4tea commented May 23, 2019

The documentation states an exchange that is declared will be done so as not durable by default but the opposite is actually true.

Rabbot is abstracting the creation of exchanges done under the hood by amqplib without specifically setting durable to false. When a user of the Rabbot library declares an exchange Rabbot does so without explicitly setting the durable flag to false. This results in exchanges being declared as durable by default which is in opposition to what's described in documentation for Rabbot.

Reproduction
Run the below and you will end up with an exchanged called "test-ex" which is, by default, durable.

const rabbot = require('rabbot')
rabbot.addConnection({user: 'guest', pass: 'guest', host: '127.0.0.1', port: 5672})
rabbot.addExchange('test-ex', 'topic', {})

Once this incongruity is understood this is only problematic in so far as some client somewhere may crash because it declares the same exchange explicitly with durable true while another client declared an exchange by default expecting the default configuration to set the exchange to true for it.

Suggestions
I suggest either updating the documentation to reflect the true default value for the durable option for exchange declaration or updating the Rabbot library to hold true to what's been described in the documentation and expected by developers.

I would also suggest re-reviewing the documentation as a whole and confirming its truth so that new developers who do follow the documentation will have an opportunity to trust more of the documentation and potentially experience less issues.

Thanks!

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