fix: Support multi-transport queue name parsing for MassTransit#3523
Draft
tippmar-nr wants to merge 6 commits intomainfrom
Draft
fix: Support multi-transport queue name parsing for MassTransit#3523tippmar-nr wants to merge 6 commits intomainfrom
tippmar-nr wants to merge 6 commits intomainfrom
Conversation
MassTransitHelpers.GetQueueData() only understood RabbitMQ-style URIs, causing all other transports (Kafka, Azure Service Bus, SQS, ActiveMQ, In-Memory) to report queue name as "Unknown" with incorrect destination type. Rewrote the parser to be scheme-aware, handling each transport's URI format. Also fixed hardcoded MessageBrokerDestinationType.Queue in the consume path of both modern and legacy NewRelicFilter.
…uration Add MassTransitTestApp project and MassTransit.Kafka/MassTransit.RabbitMQ packages to Dotty tracking. Both packages are pinned to 8.x (9.x requires a paid license) and net8.0 TFM is excluded from updates.
…3519) GetQueueData now accepts an optional fallback URI (DestinationAddress) for when SourceAddress yields Unknown — needed for Kafka Rider where the consume context SourceAddress is the bus endpoint with no queue info. Rider path prefixes (/kafka/, /event-hub/) are detected regardless of the bus transport scheme, so Kafka topics are correctly identified as Topic destination type whether the bus uses RabbitMQ, InMemory, or any other transport.
) New MassTransitTestApp exercises three transports in a single container test: - Kafka Rider: validates Topic destination type and correct topic names - RabbitMQ: validates Queue publish/send/consume through MassTransit filter - InMemory MultiBus: validates loopback:// URI parsing via DI-registered bus Also updates existing MassTransit integration test regex to accommodate the parser change from underscore-split names to full path segments, and adds unit tests for fallback address and Rider prefix detection (49 total).
…-transport-queue-parsing
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3523 +/- ##
==========================================
+ Coverage 81.79% 81.81% +0.02%
==========================================
Files 508 508
Lines 34228 34338 +110
Branches 4040 4060 +20
==========================================
+ Hits 27996 28093 +97
- Misses 5266 5276 +10
- Partials 966 969 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
Resolves #3519. MassTransit's Kafka transport (and other non-RabbitMQ transports) reported queue names as
Unknownwith destination typeQueueinstead ofTopic.Root causes:
GetQueueData()only understood RabbitMQ-style underscore-delimited URIsNewRelicFilterusedSourceAddressexclusively, which for Kafka Rider is the bus endpoint (no queue/topic info)MessageBrokerDestinationType.QueueFixes:
GetQueueData()as a scheme-aware parser supporting all MassTransit transports (Kafka, RabbitMQ, Azure Service Bus, Amazon SQS, ActiveMQ, InMemory)DestinationAddresswhenSourceAddressyieldsUnknown— handles Kafka Rider whereSourceAddressis the bus endpoint/kafka/,/event-hub/) regardless of bus transport schemeMessageBrokerDestinationType.Queuein the consume path of both modern and legacyNewRelicFilterTests:
Test plan