Fix PrefixIdentifiers not applied to GlobalPartitioned slot endpoints#2624
Merged
jeremydmiller merged 1 commit intoApr 29, 2026
Merged
Conversation
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
I ran into this combining
PrefixIdentifierswith the global partitioningfeature added in #2273. With both enabled, the partitioned slot endpoints get
registered with the un-prefixed base name while listeners for the same
shards correctly get the prefix applied. At broker startup the slot endpoint's
GetQueueUrllooks up{baseName}{N}instead of{prefix}-{baseName}{N}andthe entire transport fails to initialize:
Root cause
PartitionedMessageTopology<>(base) calls the transport-specificbuildEndpoint(options, name)for each shard slot in its constructor. Forevery transport that implements
PrefixIdentifiers,buildEndpointroutesthrough the endpoint cache directly, bypassing
MaybeCorrectName:Meanwhile
buildListener/buildSubscribergo through the publicListenTo*/To*helpers, which DO callMaybeCorrectName. The result istwo different cache entries per shard:
{baseName}{N}— slot endpoint (un-prefixed), does not exist in the broker{prefix}-{baseName}{N}— listener endpoint (prefixed), matches the real queue/topicBoth endpoints are initialized at broker startup, and the un-prefixed slot
endpoint's
GetQueueUrlcall fails because no such queue exists.Fix
Apply
MaybeCorrectNameinbuildEndpointso slot and listener resolve tothe same prefixed cache entry. Identical 1-line shape across the four affected
transports (SQS, Azure Service Bus, RabbitMQ, GCP Pub/Sub):
protected override Endpoint buildEndpoint(WolverineOptions options, string name) { - return options.XxxTransport().Queues[name]; + var transport = options.XxxTransport(); + return transport.Queues[transport.MaybeCorrectName(name)]; }NATS / Kafka / Pulsar / Redis don't trigger this mismatch — they don't
reference
MaybeCorrectNameanywhere, sobuildEndpointandbuildListenerare already consistent (both un-prefixed) for those transports.
Test plan
sharded_topology_with_prefix.prefix_is_applied_to_sharded_slot_endpointsinWolverine.AmazonSqs.Tests— fails onmain(un-prefixed slots leak), passes after the fix. Inspects options synchronously without starting the host, so no LocalStack required.