Skip to content

Introduce AddNServiceBusEndpointInstaller and deprecate old installer APIs#7683

Merged
bording merged 16 commits intomasterfrom
add-installer
Apr 2, 2026
Merged

Introduce AddNServiceBusEndpointInstaller and deprecate old installer APIs#7683
bording merged 16 commits intomasterfrom
add-installer

Conversation

@danielmarbach
Copy link
Copy Markdown
Contributor

@danielmarbach danielmarbach commented Apr 1, 2026

Summary

This PR introduces a dedicated hosting API for running endpoint installers through IServiceCollection and begins the deprecation of the older installer-specific APIs.

The goal is to make installer execution fit better into the hosting model already used for endpoints, provide a clearer and more discoverable API, and establish a migration path away from the older installer patterns.

What changed

  • Added AddNServiceBusEndpointInstaller(...) as a new way to register installer-only endpoint execution in Microsoft.Extensions.Hosting-based setups
  • Marked the existing self-hosted installer APIs as obsolete and guided users toward the new hosting-based approach
  • Added validation to ensure installer-only registration and regular endpoint registration cannot be combined incorrectly
  • Updated acceptance and unit tests to cover installer execution, multi-endpoint scenarios, and invalid registration combinations
  • Refactored the installer execution flow to align more closely with the endpoint lifecycle while ensuring installation performs setup without starting message processing

@danielmarbach danielmarbach changed the title Add installer Introduce AddNServiceBusEndpointInstaller and deprecate old installer APIs Apr 1, 2026
@danielmarbach danielmarbach added this to the 10.2.0 milestone Apr 1, 2026
@danielmarbach danielmarbach marked this pull request as ready for review April 1, 2026 16:33
/// This bypasses the default safeguards that isolate endpoints, allowing resolution of all services including
/// globally shared ones.
/// </para>
public static void AddNServiceBusEndpointInstaller(this IServiceCollection services, EndpointConfiguration endpointConfiguration, object? endpointIdentifier = null)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not entirely happy with the amount of implementation duplication going on in here compared to AddNServiceBusEndpoint, but things are just subtly different enough that I also don't see an easy way to solve it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah same for me but I figured abstracting would be worse

@bording bording merged commit b53e4a1 into master Apr 2, 2026
4 checks passed
@bording bording deleted the add-installer branch April 2, 2026 20:02
@@ -1,18 +0,0 @@
namespace NServiceBus;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch

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.

4 participants