Skip to content

Add support for the Azure Service Bus emulator running on default ports#1334

Merged
danielmarbach merged 1 commit intomasterfrom
allow-emulator-usage
Mar 17, 2026
Merged

Add support for the Azure Service Bus emulator running on default ports#1334
danielmarbach merged 1 commit intomasterfrom
allow-emulator-usage

Conversation

@stevedowling
Copy link
Contributor

@stevedowling stevedowling commented Feb 26, 2026

This pull request is based on this pull request and allows NServiceBus to use the Azure Service Bus emulator to create queues, topics, and subscriptions. The emulator is still limited to 10 connections, as detailed here, but it now exposes the Azure Service Bus Management API to allow on-the-fly changes.

Related to #1104

Copy link
Contributor

@jpalac jpalac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine, tests make sense - assume it works :-)
Do we need a CI test for this so that we know when it breaks? Especially if we are looking to put this into our docs.

@stevedowling
Copy link
Contributor Author

Do we need a CI test for this so that we know when it breaks? Especially if we are looking to put this into our docs.

How about a first imperfect step to say in the docs something like "The emulator will work with NServiceBus with these restrictions .... However, Particular does not officially support it, and we encourage the use of Azure Service Bus instead."


public bool SetupInfrastructure { get; init; }

internal int MaxDeliveryCount { get; init; } = int.MaxValue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this always set externally? If so, having the default value seems to be lying about the intent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured there was a chance that it would get created in another place later and it would get missed. I did consider making it required but that felt like a code smell with an internal member on a public class. This way, the worst case is that the emulator is affected, but Azure Service Bus connections are not.

@danielmarbach danielmarbach force-pushed the allow-emulator-usage branch 2 times, most recently from 198a152 to c70dd96 Compare March 16, 2026 13:00
@danielmarbach danielmarbach changed the title Allow emulator usage Add proper support for Azure Service Bus Emulator for development and testing Mar 16, 2026
@danielmarbach
Copy link
Contributor

/home/runner/work/NServiceBus.Transport.AzureServiceBus/NServiceBus.Transport.AzureServiceBus/src/Emulator.AcceptanceTests/bin/Release/net10.0/NServiceBus.Transport.AzureServiceBus.Emulator.AcceptanceTests.dll (.NETCoreApp,Version=v10.0)
A total of 1 test files matched the specified pattern.

Passed! - Failed: 0, Passed: 3, Skipped: 0, Total: 3, Duration: 37 s -

They ran

Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>
Co-authored-by: Yngve Bakken-Nilsen <yngve.nilsen@gmail.com>
@danielmarbach danielmarbach marked this pull request as ready for review March 17, 2026 14:42
@danielmarbach danielmarbach enabled auto-merge (squash) March 17, 2026 14:42
@danielmarbach danielmarbach changed the title Add proper support for Azure Service Bus Emulator for development and testing Add support for the Azure Service Bus emulator running on default ports Mar 17, 2026
@danielmarbach danielmarbach added this to the 6.2.0 milestone Mar 17, 2026
@danielmarbach danielmarbach merged commit 3e9d9cd into master Mar 17, 2026
4 checks passed
@danielmarbach danielmarbach deleted the allow-emulator-usage branch March 17, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants