Skip to content

Fix exchange naming with FromHandlerType routing#2428

Merged
jeremydmiller merged 1 commit intomainfrom
2397-fix-handler-type-exchange-naming
Apr 3, 2026
Merged

Fix exchange naming with FromHandlerType routing#2428
jeremydmiller merged 1 commit intomainfrom
2397-fix-handler-type-exchange-naming

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • When using UseConventionalRouting(NamingSource.FromHandlerType), exchanges were incorrectly named after the handler type instead of the message type, causing sender/listener exchange mismatch
  • Fixed MessageRoutingConvention to pass the original message type through to ApplyListenerRoutingDefaults so queues use handler type names while exchanges use message type names
  • Added tests verifying exchange naming and queue-to-exchange binding

Test plan

  • All 5 when_using_handler_type_naming tests pass against live RabbitMQ
  • exchange_should_be_named_after_message_type_not_handler_type verifies exchange uses message type
  • queue_should_be_bound_to_message_type_exchange verifies queue binds to message-type exchange

Closes #2397

🤖 Generated with Claude Code

When using UseConventionalRouting(NamingSource.FromHandlerType), exchanges
were incorrectly named after the handler type instead of the message type.
This caused a mismatch between sender exchanges (always message-type-named)
and listener exchanges, breaking message routing. Now the queue is named
after the handler type while the exchange correctly uses the message type.

Closes #2397

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit e2ae57c into main Apr 3, 2026
17 of 19 checks passed
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.

UseConventionalRouting(NamingSource.FromHandlerType) renames exchange as well

1 participant