Add Endpoint.BrokerRole for CritterWatch endpoint display (#2601)#2603
Merged
jeremydmiller merged 2 commits intomainfrom Apr 27, 2026
Merged
Add Endpoint.BrokerRole for CritterWatch endpoint display (#2601)#2603jeremydmiller merged 2 commits intomainfrom
jeremydmiller merged 2 commits intomainfrom
Conversation
Closes #2601. Adds a new virtual `string BrokerRole { get; protected set; }` on the base `Endpoint` class with default value `"endpoint"`. Each transport-specific subclass sets the value in its constructor: | Endpoint | BrokerRole | |---|---| | RabbitMqQueue | queue | | RabbitMqExchange / RabbitMqRouting | exchange | | RabbitMqTopicEndpoint | topic | | AzureServiceBusQueue | queue | | AzureServiceBusTopic | topic | | AzureServiceBusSubscription | subscription | | AmazonSqsQueue | queue | | AmazonSnsTopic | topic | | KafkaTopic | topic | | PulsarEndpoint | topic | | PubsubEndpoint | pubsub | | MqttTopic | topic | | RedisStreamEndpoint | stream | | NatsEndpoint | subject (Core) / stream (JetStream) — runtime | | SqlServer/Postgresql/Sqlite/Oracle/MySql/TenantedPostgresql Queue | queue | | DatabaseControlEndpoint | queue | | ExternalMessageTable | table | | LocalQueue | queue | | SharedMemoryTopic | topic | | SharedMemorySubscription | subscription | | StubEndpoint | stub | | TcpEndpoint | socket | | HttpEndpoint | route | | GrpcEndpoint | grpc | | SignalR{Transport,ClientEndpoint} | hub | `NatsEndpoint` overrides the property entirely because the choice between "subject" (Core NATS) and "stream" (JetStream) depends on the `UseJetStream` flag and can change after construction. Per-transport regression tests (`broker_role_tests.cs`) added in every transport / persistence test assembly so future endpoint additions catch a missing override at test time. Note: the `DisplayName` property from the issue was deferred. `EndpointName` already serves that purpose for most transports — see PR description for an audit of which subclasses still fall back to `Uri.ToString()`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both the existing Endpoint.Role (System / Application enum) and the new Endpoint.BrokerRole string are now first-class init-only properties on EndpointDescriptor. CritterWatch reads EndpointDescriptor; surfacing these directly means the UI doesn't have to crack the underlying URI to filter system-owned endpoints or render the broker object kind. Two new CoreTests cover the lift: - endpoint_descriptor_lifts_broker_role_and_endpoint_role - endpoint_descriptor_endpoint_role_reflects_system_endpoints CoreTests: 1371/1371 pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #2601.
Adds a new virtual
string BrokerRole { get; protected set; }on the baseEndpointclass with default"endpoint". Each transport-specific subclass sets it in its own ctor;NatsEndpointoverrides because Core NATS vs JetStream is a runtime choice.The companion
DisplayNameproperty described in the issue was deferred — see the audit below;EndpointNamealready covers most of that need.BrokerRole values per endpoint
BrokerRoleRabbitMqQueuequeueRabbitMqExchange,RabbitMqRoutingexchangeRabbitMqTopicEndpointtopicAzureServiceBusQueuequeueAzureServiceBusTopictopicAzureServiceBusSubscriptionsubscriptionAmazonSqsQueuequeueAmazonSnsTopictopicKafkaTopictopicPulsarEndpointtopicPubsubEndpointpubsub(per @jeremydmiller)MqttTopictopicRedisStreamEndpointstreamNatsEndpointsubject(Core NATS) /stream(JetStream) — runtime overrideSqlServerQueue,PostgresqlQueue,TenantedPostgresqlQueue,SqliteQueue,OracleQueue,MySqlQueuequeueDatabaseControlEndpointqueueExternalMessageTabletableLocalQueuequeueSharedMemoryTopictopicSharedMemorySubscriptionsubscriptionStubEndpointstubTcpEndpointsocket(per @jeremydmiller)HttpEndpointroute(per @jeremydmiller)GrpcEndpointgrpc(per @jeremydmiller)SignalRTransport,SignalRClientEndpointhub(per @jeremydmiller)Endpoint base default is
"endpoint"for any custom subclass that forgets to override.Tests
CoreTests/Configuration/broker_role_tests.cs— base default + LocalQueue, StubEndpoint, TcpEndpoint, SharedMemoryTopic, SharedMemorySubscription.broker_role_tests.csadded to every transport / persistence test assembly with a one-line check per concrete endpoint type, so any future endpoint addition that forgets to setBrokerRolefails at test time.subjectandstreamto exercise the runtime override.All
broker_role_testspass across 19 test assemblies. FullCoreTestssuite (1369/1369) passes — no regression.EndpointName audit (per Q2 in the design discussion)
Endpoint's base ctor setsEndpointName = uri.ToString()and most subclasses override it to a friendly value. The following concrete subclasses currently fall back to the URI string and may want a friendlierEndpointNamefor CritterWatch (none are touched in this PR — flagged for follow-up decision):SharedMemoryTopicmemory://topicNametopicNameSharedMemorySubscriptionmemory://topic/subName(subscription)HttpEndpointGrpcEndpointgrpc://host:port\"$host:$port\"SignalRClientEndpointsignalr://host:port/hubPulsarEndpointpersistent://tenant/ns/topicTopicNameTenantedPostgresqlQueuepostgresql://q/dbname\"$queue@$dbname\"DatabaseControlEndpointdb-control://nodeId\"Control-{NodeId}\"CosmosDbControlEndpointcosmosdb-control://nodeIdExternalMessageTableexternal-db://schema.tableTableName.QualifiedName(already friendly)TcpEndpointtcp://host:port(set explicitly to URI)\"$host:$port\"Test plan
dotnet build wolverine.slnx— full solution clean, 0 errors.dotnet test src/Testing/CoreTests --framework net9.0— 1369/1369 pass.broker_role_testspass across 19 transport / persistence test assemblies (RabbitMQ, ASB, SQS, SNS, Kafka, Pulsar, NATS, Pub/Sub, MQTT, Redis, SignalR, SqlServer, Postgresql, Sqlite, Oracle, MySql, Wolverine.Http, Wolverine.Grpc, CoreTests).🤖 Generated with Claude Code