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

ChannelCallback::cancel() not called when server delete queue #112

Closed
OverworkedCriminal opened this issue Oct 29, 2023 · 3 comments · Fixed by #113
Closed

ChannelCallback::cancel() not called when server delete queue #112

OverworkedCriminal opened this issue Oct 29, 2023 · 3 comments · Fixed by #113

Comments

@OverworkedCriminal
Copy link
Contributor

Hi,

I'm trying to detect unexpected consumer cancellations.
Based on https://www.rabbitmq.com/consumer-cancel.html
ChannelCallback::cancel() seems to be the best for this, but I can't make it work.

I tried doing something like this:

  1. open connection
  2. register connection callback
  3. open channel
  4. register channel callback
  5. declare queue
  6. channel.basic_consume(...)
  7. remove queue using rabbitmqctl

But ChannelCallback::cancel() was not called.

Did I miss some configuration?

Probable cause

I've read here https://www.rabbitmq.com/connections.html#capabilities
that this extension (consumer_cancel_notify) needs to be present in client capabilities, otherwise RabbitMQ does not send any notification.

I modified Connection::open() to check if it would help, and it did.
amqprs missing client capabilities

versions:
Rust: 1.73
amqprs: 1.5.0

@lukebakken
Copy link

lukebakken commented Oct 29, 2023

Thank you - good job investigating this issue!

@OverworkedCriminal - feel free to open a pull request with your change and, ideally, with a test.

@OverworkedCriminal
Copy link
Contributor Author

I opened pull request #113 (not sure how to link it to this issue)
I'll see if i can write test for it

@lukebakken
Copy link

@OverworkedCriminal thank you!

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 a pull request may close this issue.

2 participants