Skip to content

Comments

Fix conventional routing endpoint discovery in FindResources#2174

Merged
jeremydmiller merged 3 commits intomainfrom
asb-testing
Feb 14, 2026
Merged

Fix conventional routing endpoint discovery in FindResources#2174
jeremydmiller merged 3 commits intomainfrom
asb-testing

Conversation

@jeremydmiller
Copy link
Member

Summary

  • Re-enables endpoint discovery from routing conventions during FindResources() (originally fixed in Routing conventions need to apply to the stateful resource model operations #513, then reverted due to regression)
  • Fixes the regression by clearing the route cache after discovery so routes with null Sender created during WithinDescription mode are not reused for actual message sending
  • Adds Azure Service Bus emulator testing scaffolding (Testcontainers)

Background

WolverineSystemPart.FindResources() needs to discover all transport endpoints (exchanges, queues) so they can be provisioned/torn down as stateful resources. The original fix (GH-513) called RoutingFor() for each message type during FindResources(), which triggered MessageRoutingConvention.DiscoverSenders() and created the endpoints as a side effect.

However, RoutingFor() caches routes in _messageTypeRouting. Routes created during FindResources() have WithinDescription=true, which allows null Sender on MessageRoute. When those cached routes were later reused for actual message sending, Envelope(message, Sender) threw NullReferenceException because Sender was null.

The fix calls ClearRoutingFor() for each discovered message type after the routing loop, preserving the endpoint discovery side effect while ensuring routes get properly rebuilt with active sending agents when the host starts.

Test plan

  • find_endpoints_through_conventions_as_part_of_find_resources passes
  • All 6 StatefulResourceSmokeTests pass
  • All 23 ConventionalRouting tests pass
  • All 9 RabbitMqTransportTests pass
  • end_to_end tests: 23/25 pass (2 pre-existing flaky failures from stale broker state)

Closes GH-513

🤖 Generated with Claude Code

jeremydmiller and others added 2 commits February 12, 2026 19:06
…ing stale routes

Re-enable endpoint discovery from routing conventions during FindResources()
(originally GH-513) and fix the regression that caused it to be reverted.
The fix clears the route cache after discovery so routes with null Sender
created during WithinDescription mode are not reused for actual message sending.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Routing conventions need to apply to the stateful resource model operations

1 participant