Closed hoylen closed 2 years ago
Thanks for your contribution.
Please rebase your changes on top of HEAD so we can get a clean CI run and get this merged.
Thanks. I think I've done it correctly, but am not sure if I have used the correct sequence of git commands.
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.https://github.com/achilleasa/dart_amqp/blob/0231485e4584487eb7faefe2ecb1a6f3396338d4/lib/src/client/impl/exchange_impl.dart#L88
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 thebindQueueConsumer
method. That way, the invoker can indicate they want to bind to a durable queue. For example,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.