Skip to content

Add config option for enabling local_random_exchange #14348

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

Merged

Conversation

udeeksha30-netizen
Copy link
Contributor

@udeeksha30-netizen udeeksha30-netizen commented Aug 8, 2025

Proposed Changes

This adds config option which can be used to prevent creation of local random exchanges. If RabbitMQ is behind a load balancer then local random exchanges can't be used effectively, so it would be useful for operators to set enable_local_random_exchange = false to prevent them from being created.

Types of Changes

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

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
This is simply a reminder of what we are going to look for before merging your code.

  • Mandatory: I (or my employer/client) have have signed the CA (see https://github.com/rabbitmq/cla)
  • I have read the CONTRIBUTING.md document
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

CLA

This contribution is from AWS, who have signed the CLA.

@the-mikedavis the-mikedavis self-assigned this Aug 8, 2025
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

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

With the exception of a few really old (circa 2015) settings that pre-date even rabbitmq.conf, the key naming pattern for such settings is usually

{feature}.enabled = true | false

So I'd prefer

exchange_types.local_random.enabled = false

(we do not really have any similar exchange settings, except for log.exchange but that's a stretch because it's a log setting)

Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

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

rabbit_exchange_type_local_random now uses uses two different app environment keys (rabbit.local_random_exchange_enabled, rabbit.enable_local_random_exchange), and both application:get_env/3 and rabbit_misc:get_env/3.

@michaelklishin michaelklishin merged commit 2024a4b into rabbitmq:main Aug 11, 2025
281 of 283 checks passed
michaelklishin added a commit that referenced this pull request Aug 11, 2025
Add config option for enabling local_random_exchange (backport #14348)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants