Skip to content

Fix global partitioning with Separated handler mode#2293

Merged
jeremydmiller merged 1 commit intomainfrom
fix/global-partition-separated-handler-fanout
Mar 12, 2026
Merged

Fix global partitioning with Separated handler mode#2293
jeremydmiller merged 1 commit intomainfrom
fix/global-partition-separated-handler-fanout

Conversation

@jeremydmiller
Copy link
Member

Summary

  • Fixes NoHandlerForEndpointException when combining global partitioning with MultipleHandlerBehavior.Separated
  • Extends the fanout handler logic in HandlerGraph.HandlerFor(Type, Endpoint) to also activate when the incoming local queue is part of a sharded/global partition topology (UsedInShardedTopology = true)
  • Adds integration test with two global partitions, multiple handlers per message type, and cascading messages

Problem

When global partitioning routes messages to companion local queues and Separated mode moves all handlers to sticky handler-specific local queues:

  1. Message arrives at local://partition-a2/ (global partition companion queue)
  2. No sticky handler matches this endpoint
  3. Fanout handler logic checks endpoint is not LocalQueue — but it IS a LocalQueue
  4. Falls through to throw new NoHandlerForEndpointException

Fix

The fanout handler should also be created when the incoming LocalQueue is part of a sharded topology (not a sticky handler's own queue). The UsedInShardedTopology property on the endpoint distinguishes partition queues from arbitrary local queues, preserving the existing NoHandlerForEndpointException behavior for misrouted messages.

Test plan

  • New integration test passes: two global partitions, four handlers (two per message type), cascading message flow
  • All 1161 CoreTests pass (1160 existing + 1 new), including get_an_explanatory_message which validates that NoHandlerForEndpointException is still thrown for arbitrary unhandled local queues

Supersedes #2292

🤖 Generated with Claude Code

…d handlers

When global partitioning routes messages to companion local queues and
MultipleHandlerBehavior.Separated moves all handlers to sticky handler-
specific local queues, the fanout handler logic in HandlerFor(Type, Endpoint)
was not triggered because it only activated for non-LocalQueue endpoints.

Extend the fanout condition to also apply when the incoming local queue is
part of a sharded/global partition topology (UsedInShardedTopology = true),
so messages arriving on partition companion queues are correctly relayed
to all sticky handler queues.

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.

1 participant