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

Added queue properties to bindQueueConsumer and bindPrivateQueueConsumer #78

Merged
merged 2 commits into from
Nov 2, 2022
Merged

Added queue properties to bindQueueConsumer and bindPrivateQueueConsumer #78

merged 2 commits into from
Nov 2, 2022

Conversation

hoylen
Copy link
Contributor

@hoylen hoylen commented Sep 27, 2022

Problem

Version 0.2.1 cannot bind to persistent/durable queues.

The implementation of bindQueueConsumer (in the _ExchangeImpl class) invokes channel.queue only with the queueName, so the durable parameter always defaults to false.

Queue queue = await channel.queue(queueName);

If the queue did not exist, it was created as non-durable.

If it did exist, an exception would be thrown because the existing queue has durable=true and this line is trying to get a queue with durable=false.

Solution

This pull request adds durable (and all the other parameters the queue method can have) to the parameters of the bindQueueConsumer method. That way, the invoker can indicate they want to bind to a durable queue. For example,

exchange.bindQueueConsumer('my_queue_name', noAck: false, durable: true);

For consistency, it does the same thing to bindPrivateQueueConsumer.

The change is backward compatible, since the added parameters are all named parameters that are either nullable or have default values.

@achilleasa
Copy link
Owner

Thanks for your contribution.

Please rebase your changes on top of HEAD so we can get a clean CI run and get this merged.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.115% when pulling 34a13ab on hoylen:bind-queue-properties into f1844ca on achilleasa:master.

@hoylen
Copy link
Contributor Author

hoylen commented Nov 2, 2022

Thanks. I think I've done it correctly, but am not sure if I have used the correct sequence of git commands.

@achilleasa achilleasa merged commit 9e41b8e into achilleasa:master Nov 2, 2022
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

Successfully merging this pull request may close these issues.

3 participants