Skip to content

Fix conventional routing not creating listeners for batch element types#2310

Merged
jeremydmiller merged 1 commit intomainfrom
fix/2307-batching-conventional-routing
Mar 16, 2026
Merged

Fix conventional routing not creating listeners for batch element types#2310
jeremydmiller merged 1 commit intomainfrom
fix/2307-batching-conventional-routing

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Fixes Message Batching Listener Registration Fails When Using Service Bus + Conventional Routing #2307: BatchMessagesOf<T>() combined with conventional routing (Azure Service Bus, RabbitMQ, etc.) never created external transport listeners for the element type T, because discoverListenersFromConventions() only included types with handler chains (T[] has the chain, not T)
  • Adds batch element types from BatchDefinitions to the handledMessageTypes list in discoverListenersFromConventions()
  • Updates MessageRoutingConvention.DiscoverListeners() to create listeners for batch element types even when they lack their own handler chain
  • Adds null check in LocalTransport.DiscoverListeners() for batch element types that have no chain in HandlerGraph

Test plan

  • Added Bug_2307_batching_with_conventional_routing test in Azure Service Bus tests verifying a listener endpoint is created for the batch element type
  • Run all message batching tests (batch_processing)
  • Run all Azure Service Bus tests
  • Run all RabbitMQ conventional routing tests (shared MessageRoutingConvention base class was modified)

🤖 Generated with Claude Code

…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>
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.

Message Batching Listener Registration Fails When Using Service Bus + Conventional Routing

1 participant