Skip to content

Set EndpointName on RabbitMqRouting so sending endpoints are named in health snapshots (GH-3270)#3273

Merged
jeremydmiller merged 1 commit into
mainfrom
feat/rabbitmq-routing-endpoint-name-3270
Jun 28, 2026
Merged

Set EndpointName on RabbitMqRouting so sending endpoints are named in health snapshots (GH-3270)#3273
jeremydmiller merged 1 commit into
mainfrom
feat/rabbitmq-routing-endpoint-name-3270

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Closes #3270.

Name fix (the bug)

RabbitMQ exchange + routing-key sending endpoints (RabbitMqRouting) set ExchangeName and BrokerRole but never EndpointName, so they fell through to the base default (the synthetic rabbitmq://exchange/{name}/routing/{key} Uri). In EndpointCollection.CollectEndpointHealth() that surfaces as a blank / "unknown" Name (and makes per-endpoint sent metrics impossible to join to a recognizable endpoint).

RabbitMqRouting now sets a recognizable EndpointName:

  • named exchange → "{exchange}/{routingKey}" (e.g. orders/high-priority)
  • default exchange → just the routing key (the default exchange routes by key, which is the target queue name)

Status (already satisfied on main)

The issue also asked for a broker-connection-aware sender status instead of Unknown. That's already in place: RabbitMqChannelAgent (the base of RabbitMqSender) implements IReportConnectionState, and EndpointCollection.connectionStateOf(ISendingAgent) reaches through the sending agent to the sender — so the snapshot's ConnectionState reports Connected/Disconnected. Added a regression test asserting that contract.

(Note: AgentState has only Connected/Disconnected today, so Reconnecting is not yet reported — a possible small follow-up.)

Tests

Broker-free unit tests (4): named-exchange and default-exchange routing names, the name is not the synthetic Uri, and RabbitMQ senders implement IReportConnectionState.

🤖 Generated with Claude Code

…ts are named in health snapshots (GH-3270)

RabbitMQ exchange+routing-key sending endpoints (RabbitMqRouting) never set
EndpointName, so they fell through to the synthetic Uri and showed as a blank /
"unknown" Name in EndpointCollection.CollectEndpointHealth() (and could not be
joined to per-endpoint sent metrics). RabbitMqRouting now sets a recognizable
EndpointName: "{exchange}/{routingKey}" for a named exchange, or just the routing
key for the default exchange (which routes by key = the target queue name).

The broker-connection status half of the issue is already satisfied on main:
RabbitMqChannelAgent (the base of RabbitMqSender) implements IReportConnectionState,
and EndpointCollection.connectionStateOf reaches through the sending agent to the
sender, so the snapshot's ConnectionState reports Connected/Disconnected rather than
Unknown. Added a regression test asserting that contract. (AgentState has no
Reconnecting state today, so that value is not yet reported.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 07f75e5 into main Jun 28, 2026
25 checks passed
This was referenced Jun 29, 2026
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.

RabbitMQ sending endpoints: set EndpointName on RabbitMqRouting/default exchange + report a broker-connection status

1 participant