Skip to content

[DO NOT MERGE] Allow disabling RabbitMQ broker requirement checks#5353

Draft
dvdstelt wants to merge 4 commits intomasterfrom
feature/disable-broker-requirement-checks
Draft

[DO NOT MERGE] Allow disabling RabbitMQ broker requirement checks#5353
dvdstelt wants to merge 4 commits intomasterfrom
feature/disable-broker-requirement-checks

Conversation

@dvdstelt
Copy link
Member

@dvdstelt dvdstelt commented Mar 10, 2026

Motivation

In multi-tenant RabbitMQ deployments, granting management API access to individual tenants is a security risk. ServiceControl currently performs broker requirement checks that depend on management API access, with no way to disable them.

The RabbitMQ transport (v11.0.0) already supports DisabledBrokerRequirementChecks, but ServiceControl did not expose it.

What this does

Adds DisableBrokerRequirementChecks=true as a connection string parameter:

host=rabbitmq;username=tenant1;password=secret;DisableBrokerRequirementChecks=true

When enabled, this:

  • Disables broker version and stream feature checks at startup
  • Disables delivery limit validation (also requires management API)
  • Skips registration of RabbitMQQuery (broker throughput collection) and QueueLengthProvider (queue length monitoring), both of which require management API access
  • Registers a NoOpQueueLengthProvider to satisfy DI requirements

What still works without management API access

  • Sending and receiving messages
  • Usage reports and license validation (via audit and monitoring data sources)

What becomes unavailable

  • Queue length monitoring in ServicePulse
  • Broker-sourced throughput data in usage reports

…tring

For multi-tenant RabbitMQ deployments where tenants cannot be granted
management API access, operators can now add
DisableBrokerRequirementChecks=true to the connection string.
@dvdstelt dvdstelt self-assigned this Mar 10, 2026
Copy link
Member

@SzymonPobiega SzymonPobiega left a comment

Choose a reason for hiding this comment

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

LGTM

Delivery limit validation also requires management API access, so it
must be disabled together with broker requirement checks.
When DisableBrokerRequirementChecks=true, do not register
RabbitMQQuery (broker throughput) or QueueLengthProvider, since both
require management API access that the user has indicated is
unavailable. A NoOpQueueLengthProvider is registered instead to
satisfy the DI requirement.
@dvdstelt dvdstelt changed the title [WIP] Allow disabling RabbitMQ broker requirement checks Allow disabling RabbitMQ broker requirement checks via connection string Mar 12, 2026
@dvdstelt dvdstelt changed the title Allow disabling RabbitMQ broker requirement checks via connection string Allow disabling RabbitMQ broker requirement checks Mar 12, 2026
@dvdstelt dvdstelt requested a review from SzymonPobiega March 12, 2026 13:08
protected override void AddTransportForPrimaryCore(IServiceCollection services, TransportSettings transportSettings)
=> services.AddSingleton<IBrokerThroughputQuery, RabbitMQQuery>();
{
if (!RabbitMQTransportExtensions.HasBrokerRequirementChecksDisabled(transportSettings.ConnectionString))
Copy link
Member

Choose a reason for hiding this comment

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

What happens if that's false? I mean what uses the IBrokerThroughputQuery and is that dependency optional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Extract ParseConnectionString helper to eliminate duplicated
DbConnectionStringBuilder logic. Add warning log on startup when
queue length monitoring is disabled. Mark NoOpQueueLengthProvider
as sealed with explanatory comment.
@dvdstelt dvdstelt marked this pull request as draft March 13, 2026 22:30
@dvdstelt dvdstelt changed the title Allow disabling RabbitMQ broker requirement checks [DO NOT MERGE] Allow disabling RabbitMQ broker requirement checks Mar 13, 2026
@dvdstelt dvdstelt requested a review from bording March 13, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants