Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the Customization with MEF or Reflection sample #6909

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nservicebus/lifecycle/endpointstartandstop.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ There are several options available to execute custom code as part of the endpoi

* Writing code directly after calling `Endpoint.Start` or `endpointInstance.Stop`.
* Adding a custom [FeatureStartupTask](/nservicebus/pipeline/features.md#feature-startup-tasks).
* [Using MEF or Reflection](/samples/plugin-based-config) to run code at startup and shutdown in a pluggable way.
* [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.

> [!WARNING]
> The `IWantToRunWhenBusStartsAndStops` interface is no longer available as part of the `NServiceBus` package.
6 changes: 4 additions & 2 deletions nservicebus/lifecycle/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: Interface lifecycles
summary: The lifecycles of the various NServiceBus configuration interfaces
reviewed: 2023-05-14
reviewed: 2024-11-19
redirects:
- samples/plugin-based-config
---

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.
Expand All @@ -10,4 +12,4 @@ The most common lifecycle extension points include:

- [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.
- [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.
- [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.
- [Endpoint Instance Started/Stopped](/nservicebus/lifecycle/endpointstartandstop.md): This article describes approaches to running tasks around the endpoint startup and shutdown lifecycle events.
2 changes: 1 addition & 1 deletion nservicebus/sagas/reply-replytooriginator-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ redirects:

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.

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_.
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_.

> [!NOTE]
> The `Reply` method always delivers the message to the sender address of the incoming message.
Expand Down
5 changes: 2 additions & 3 deletions nservicebus/upgrades/5to6/endpoint.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Endpoint API changes in NServiceBus Version 6
reviewed: 2023-03-31
reviewed: 2024-11-19
component: Core
isUpgradeGuide: true
upgradeGuideCoreVersions:
Expand Down Expand Up @@ -29,6 +29,7 @@ The endpoint name is used as a logical identifier when sending or receiving mess

The `IWantToRunWhenBusStartsAndStops` interface is now obsolete.

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

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

Expand Down Expand Up @@ -69,8 +70,6 @@ While the [Dispose Pattern](https://docs.microsoft.com/en-us/dotnet/standard/des
* [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).
* [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).

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/).

### Using [NServiceBus.Host](/nservicebus/hosting/nservicebus-host/)

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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading