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

Allow changing queue names during recovery #693

Merged

Conversation

vikinghawk
Copy link
Contributor

@vikinghawk vikinghawk commented Jul 2, 2021

Proposed Changes

Allow a consumer to register a callback to change the name of a queue during recovery. This is useful when dealing with transient and auto-delete queues that are susceptible to 404 NOT_FOUND client recovery errors and binding corruption issues during cluster node cycles/upgrades. When a client reconnects and redeclares the queue, we expose a timing issue due to the server trying to cleanup the queue at the same time the client is coming back to redeclare it.

The easy existing alternative is to use server named queues. However, with that consumers have no ability to provide a useful queue name that makes it easy to tell what application a queue belongs too from a monitoring/troubleshooting perspective.

This enhancement allows for applications to still name queues in meaningful ways, but to then support modifying that name during a recovery to avoid the timing issues described above.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

if(q.isServerNamed()) {
deleteRecordedQueue(oldName);
}
deleteRecordedQueue(oldName);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wanted to call out that this is removing the q.isServerNamed() check here. But i don't think that is an issue as i don't believe their would have historically been anyway for the name to change unless it was server named.

@michaelklishin michaelklishin merged commit 5b740ce into rabbitmq:5.x.x-stable Jul 3, 2021
@michaelklishin
Copy link
Member

Thank you!

@michaelklishin michaelklishin added this to the 5.13.0 milestone Jul 3, 2021
@michaelklishin
Copy link
Member

@vikinghawk can you please submit this PR against main?

@michaelklishin
Copy link
Member

Actually no need to do that, I managed to merge 5.x.x-stable into main.

@vikinghawk vikinghawk deleted the renameQueueOnRecovery branch July 6, 2021 13:20
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.

None yet

2 participants