GH-3366: ship a real UseAzureServiceBusEmulator() API#3409
Merged
Conversation
…ge (GH-3366) The docs told readers to call UseAzureServiceBusTesting(), but that extension method only existed in the test suite and depended on the test-only Servers type. Add a shipping UseAzureServiceBusEmulator() with defaulted and explicit connection-string overloads, an opt-in DeleteAllExistingObjectsOnStartup() for the destructive namespace wipe, and a standalone cleanup helper. Refactor the test helper onto the new API and rewrite the emulator docs around compiled snippets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 14, 2026
This was referenced Jul 18, 2026
Open
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.
Problem
Several Azure Service Bus doc pages told readers to call
UseAzureServiceBusTesting(), but that extension method was never in the shippingWolverineFx.AzureServiceBuspackage -- it lived only inWolverine.AzureServiceBus.Testsand depended on the test-infrastructureServerstype. Readers following the docs got a compile error.Per the maintainer decision on the issue, this takes Option 1: promote a real API into the shipping package rather than walking the docs back.
New public API surface (
Wolverine.AzureServiceBus)AzureServiceBusEmulatorExtensions(new):AzureServiceBusConfiguration(new method):AzureServiceBusTransport(new property, honored inConnectAsync):Both
UseAzureServiceBusEmulator()overloads setManagementConnectionStringand return the sameAzureServiceBusConfigurationasUseAzureServiceBus(), soAutoProvision(),AutoPurgeOnStartup(), conventional routing, etc. all chain off of them.Opt-in cleanup decision
The test-only helper unconditionally deleted every queue and topic in the namespace. That is far too dangerous to make default behavior in a shipped API -- someone who points
UseAzureServiceBusEmulator()at a real namespace by mistake (or with a copy/pasted connection string) must not lose their entities. So the wipe is opt in only, viaDeleteAllExistingObjectsOnStartup(), and it is documented as destructive and irreversible with a::: dangercallout.DeleteAllAzureServiceBusObjectsAsync(...)is also available for out-of-band cleanup (e.g. once per test run rather than once per host start), which is exactly how Wolverine's own test suite now uses it.Tests and docs
Wolverine.AzureServiceBus.Tests/AzureServiceBusTesting.csnow delegates to the shipping API -- no duplicate implementation. The whole ASB suite still goes through it, so the new API is exercised end-to-end on CI.emulator_configuration.csunit tests cover both overloads and assert the destructive cleanup is off by default.emulator.mdrewritten around the now-real API (compiled<!-- snippet: ... -->blocks fromDocumentationSamples.cs), plus fixes toindex.md,session-identifiers.md, andconventional-routing.md. The doc-facing samples that previously pulled from tests callingUseAzureServiceBusTesting()were moved intoDocumentationSamples.csand now showUseAzureServiceBusEmulator(). NoUseAzureServiceBusTesting()references remain anywhere indocs/.Verification
dotnet build wolverine.slnx -c Release-- clean, 0 warnings / 0 errors.emulator_configurationtests pass locally (4/4).Fixes #3366
🤖 Generated with Claude Code