Skip to content

Commit 2669c4d

Browse files
authored
Remove the Customization with MEF or Reflection sample (#6909)
* Update index.md Add a redirect for samples/plugin-based-config Add a link to the Generic Host lifecycle documentation * Remove samples/plugin-based-config/ * Update the NSB 5to6 endpoint upgrade guide * Fix broken link * Replace the MEF/reflection sample with Generic Host lifecycle * Simplify the endpoint instance start/stop description
1 parent 5945c00 commit 2669c4d

File tree

92 files changed

+8
-1752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+8
-1752
lines changed

nservicebus/lifecycle/endpointstartandstop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ There are several options available to execute custom code as part of the endpoi
1313

1414
* Writing code directly after calling `Endpoint.Start` or `endpointInstance.Stop`.
1515
* Adding a custom [FeatureStartupTask](/nservicebus/pipeline/features.md#feature-startup-tasks).
16-
* [Using MEF or Reflection](/samples/plugin-based-config) to run code at startup and shutdown in a pluggable way.
16+
* [Using the Generic Host lifecycle](https://learn.microsoft.com/en-us/dotnet/core/extensions/generic-host?tabs=appbuilder#ihostapplicationlifetime) to run tasks during the application's lifecycle.
1717

1818
> [!WARNING]
1919
> The `IWantToRunWhenBusStartsAndStops` interface is no longer available as part of the `NServiceBus` package.

nservicebus/lifecycle/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
title: Interface lifecycles
33
summary: The lifecycles of the various NServiceBus configuration interfaces
4-
reviewed: 2023-05-14
4+
reviewed: 2024-11-19
5+
redirects:
6+
- samples/plugin-based-config
57
---
68

79
Each endpoint instance goes through a series of events as it is configured, constructed, started, and stopped. NServiceBus provides extension points that allow to execute code at specific stages of the instance lifecycle.
@@ -10,4 +12,4 @@ The most common lifecycle extension points include:
1012

1113
- [Initialization](/nservicebus/lifecycle/ineedinitialization.md): Called when the endpoint is first created. Extensions added to this part of the lifecycle typically contribute to the configuration of the endpoint.
1214
- [Before Configuration Finalized](/nservicebus/lifecycle/iwanttorunbeforeconfigurationisfinalized.md): Called just before the configuration is made read-only and the endpoint is started. Extensions added to this part of the lifecycle are usually last minute checks or tweaks to other parts of endpoint configuration.
13-
- [Endpoint Instance Started/Stopped](/nservicebus/lifecycle/endpointstartandstop.md): Called after the endpoint has been started and before it is stopped. In NServiceBus version 6 and above, these extension points have been moved to the hosts. For self-hosted endpoints, call the desired code directly after starting and before stopping the endpoint rather than relying on explicit NServiceBus extension points.
15+
- [Endpoint Instance Started/Stopped](/nservicebus/lifecycle/endpointstartandstop.md): This article describes approaches to running tasks around the endpoint startup and shutdown lifecycle events.

nservicebus/sagas/reply-replytooriginator-differences.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ redirects:
88

99
When building systems using the [request/response pattern](/nservicebus/messaging/reply-to-a-message.md), the `Reply` method exposed by the `IMessageHandlerContext` is used to reply to the sender of the incoming message.
1010

11-
The same `Reply` method can be used inside a [saga](nservicebus/sagas/) and it is important to understand that the `Reply` method always routes the message to the sender of the incoming message, _not the endpoint that started the saga_.
11+
The same `Reply` method can be used inside a [saga](/nservicebus/sagas/) and it is important to understand that the `Reply` method always routes the message to the sender of the incoming message, _not the endpoint that started the saga_.
1212

1313
> [!NOTE]
1414
> The `Reply` method always delivers the message to the sender address of the incoming message.

nservicebus/upgrades/5to6/endpoint.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Endpoint API changes in NServiceBus Version 6
3-
reviewed: 2023-03-31
3+
reviewed: 2024-11-19
44
component: Core
55
isUpgradeGuide: true
66
upgradeGuideCoreVersions:
@@ -29,6 +29,7 @@ The endpoint name is used as a logical identifier when sending or receiving mess
2929

3030
The `IWantToRunWhenBusStartsAndStops` interface is now obsolete.
3131

32+
If the extensibility provided by `IWantToRunWhenBusStartsAndStops` is still required, it can be achieved via other means in the [NServiceBus endpoint lifecycle](/nservicebus/lifecycle/).
3233

3334
### [Self-hosting](/nservicebus/hosting/#self-hosting)
3435

@@ -69,8 +70,6 @@ While the [Dispose Pattern](https://docs.microsoft.com/en-us/dotnet/standard/des
6970
* [Windows Service Hosting](/nservicebus/hosting/windows-service.md) where startup is usually done in [ServiceBase.OnStart](https://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase.onstart.aspx) and shutdown is usually done in [ServiceBase.OnStop](https://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase.onstop.aspx).
7071
* [Web Site or Web Service Hosting](/nservicebus/hosting/web-application.md) where startup is usually done in [HttpApplication.Application_Start](https://msdn.microsoft.com/en-us/library/ms178473.aspx) and shutdown is usually done in [HttpApplication.Dispose](https://msdn.microsoft.com/en-us/library/system.web.httpapplication.dispose.aspx).
7172

72-
If the extensibility provided by `IWantToRunWhenBusStartsAndStops` is still required, it can be achieved via other means, such as [using MEF or reflection to customize NServiceBus](/samples/plugin-based-config/).
73-
7473
### Using [NServiceBus.Host](/nservicebus/hosting/nservicebus-host/)
7574

7675
See the upgrade guide for more details on [using the new interface](/nservicebus/upgrades/host-6to7.md) provided by the host.

samples/plugin-based-config/Core_7/CustomExtensionEndpoint/CustomExtensionEndpoint.csproj

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/plugin-based-config/Core_7/CustomExtensionEndpoint/Program.cs

Lines changed: 0 additions & 54 deletions
This file was deleted.

samples/plugin-based-config/Core_7/CustomExtensionEndpoint/Resolver.cs

Lines changed: 0 additions & 60 deletions
This file was deleted.

samples/plugin-based-config/Core_7/CustomExtensions/CustomExtensions.csproj

Lines changed: 0 additions & 9 deletions
This file was deleted.

samples/plugin-based-config/Core_7/CustomExtensions/CustomizeConfiguration.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

samples/plugin-based-config/Core_7/CustomExtensions/RunAfterEndpointStart.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)