You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nservicebus/messaging/publish-subscribe/controlling-what-is-subscribed.md
+6-7Lines changed: 6 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,17 @@
2
2
title: Controlling What Is Subscribed
3
3
summary: When applying the publish-subscribe pattern, there are several ways to control what messages are subscribed to
4
4
component: Core
5
-
reviewed: 2023-05-14
5
+
reviewed: 2025-05-09
6
6
---
7
7
8
-
9
8
## Automatic subscriptions
10
9
11
10
The default mode for managing subscriptions is *auto-subscribe*. Every time a subscriber endpoint starts, it determines which events it needs to subscribe to and automatically subscribes to them. For more information on how publish and subscribe works, refer to [Publish-Subscribe](/nservicebus/messaging/publish-subscribe).
12
11
13
-
Messages matching both of the following criteria will be auto-subscribed at startup:
12
+
Message types matching both of the following criteria will be auto-subscribed at startup:
14
13
15
-
1. Defined as an event either using `IEvent` or by the `.DefiningEventsAs` convention.
16
-
1. At least one [message handler and/or saga](/nservicebus/handlers/) exists for the given event.
14
+
1. Defined as an event either using `IEvent` or by the `.DefiningEventsAs` convention
15
+
1. At least one [message handler and/or saga](/nservicebus/handlers/) exists for the given event
17
16
18
17
> [!NOTE]
19
18
> If the selected transport [does not support publish-subscribe natively](/transports/types.md#unicast-only-transports), the publisher for that message must be specified via the [routing](/nservicebus/messaging/routing.md) API.
In NServiceBus version 6 and above, it is possible to subscribe to messages not defined as events by [manually subscribing](/nservicebus/messaging/publish-subscribe/controlling-what-is-subscribed.md#manually-subscribing-to-a-message) to the message type.
39
38
40
39
41
-
###When a subscriber stops or uninstalls
40
+
## When a subscriber stops or uninstalls
42
41
43
-
A subscriber will not unsubscribe when it stops; it will remain registered at the publisher to receive events. The publisher still sends events to the queue of the stopped subscriber. When the subscriber is started, it will consume the messages from its queue. The subscriber will never lose an event.
42
+
A subscriber will not auto unsubscribe when it stops; it will remain registered at the publisher to receive events. The publisher still sends events to the queue of the stopped subscriber. When the subscriber is started, it will consume the messages from its queue. The subscriber will never lose an event.
0 commit comments