Fix conventional routing not creating listeners for batch element types#2310
Merged
jeremydmiller merged 1 commit intomainfrom Mar 16, 2026
Merged
Conversation
…es (#2307) When using BatchMessagesOf<T>() with conventional routing, external transport listeners were never created for the element type T because discoverListenersFromConventions() only included types with handler chains (T[] has the chain, not T). This meant messages published to the broker queue for T had no listener to receive them. The fix adds batch element types from BatchDefinitions to the handledMessageTypes list passed to DiscoverListeners(), and updates MessageRoutingConvention to create listeners for batch element types even when they lack their own handler chain. Also adds a null check in LocalTransport.DiscoverListeners() since batch element types have no chain in the HandlerGraph. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 17, 2026
This was referenced Mar 29, 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
BatchMessagesOf<T>()combined with conventional routing (Azure Service Bus, RabbitMQ, etc.) never created external transport listeners for the element typeT, becausediscoverListenersFromConventions()only included types with handler chains (T[]has the chain, notT)BatchDefinitionsto thehandledMessageTypeslist indiscoverListenersFromConventions()MessageRoutingConvention.DiscoverListeners()to create listeners for batch element types even when they lack their own handler chainLocalTransport.DiscoverListeners()for batch element types that have no chain inHandlerGraphTest plan
Bug_2307_batching_with_conventional_routingtest in Azure Service Bus tests verifying a listener endpoint is created for the batch element typebatch_processing)MessageRoutingConventionbase class was modified)🤖 Generated with Claude Code