Skip to content

Commit 709f1a4

Browse files
JoshVanLmsfussellhhunter-ms
authored
HotReload: Subscription feature preview (#4116)
* HotReload: Subscription feature preview Document Declarative Subscription hot reloading preview feature from dapr/dapr#7583 Signed-off-by: joshvanl <[email protected]> * Apply suggestions from code review Co-authored-by: Hannah Hunter <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> * Move feature preview line to top of note Signed-off-by: joshvanl <[email protected]> * Add subscription hot reload note to pubsub-overview Signed-off-by: joshvanl <[email protected]> * Adds extra not about subscription hot reloading Signed-off-by: joshvanl <[email protected]> * Update daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md Signed-off-by: Mark Fussell <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Signed-off-by: Josh van Leeuwen <[email protected]> Signed-off-by: Mark Fussell <[email protected]> Co-authored-by: Mark Fussell <[email protected]> Co-authored-by: Hannah Hunter <[email protected]>
1 parent 5c25364 commit 709f1a4

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md

+7
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ The example above shows an event subscription to topic `orders`, for the pubsub
184184

185185
Place `subscription.yaml` in the same directory as your `pubsub.yaml` component. When Dapr starts up, it loads subscriptions along with the components.
186186

187+
{{% alert title="Note" color="primary" %}}
188+
This feature is currently in preview.
189+
Dapr can be made to "hot reload" declarative subscriptions, whereby updates are picked up automatically without needing a restart.
190+
This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}).
191+
To prevent reprocessing or loss of unprocessed messages, in-flight messages between Dapr and your application are unaffected during hot reload events.
192+
{{% /alert %}}
193+
187194
Below are code examples that leverage Dapr SDKs to subscribe to the topic you defined in `subscription.yaml`.
188195

189196
{{< tabs Dotnet Java Python Go JavaScript>}}

daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-overview.md

+7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ Dapr applications can subscribe to published topics via two methods that support
8484

8585
For more information, read [about the subscriptions in Subscription Methods]({{< ref subscription-methods.md >}}).
8686

87+
### Reloading topic subscriptions
88+
89+
To reload topic subscriptions that are defined programmatically or declaratively, the Dapr sidecar needs to be restarted.
90+
The Dapr sidecar can be made to dynamically reload changed declarative topic subscriptions without restarting by enabling the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}).
91+
Hot reloading of topic subscriptions is currently a preview feature.
92+
In-flight messages are unaffected when reloading a subscription.
93+
8794
### Message routing
8895

8996
Dapr provides [content-based routing](https://www.enterpriseintegrationpatterns.com/ContentBasedRouter.html) pattern. [Pub/sub routing]({{< ref howto-route-messages.md >}}) is an implementation of this pattern that allows developers to use expressions to route [CloudEvents](https://cloudevents.io) based on their contents to different URIs/paths and event handlers in your application. If no route matches, an optional default route is used. This is useful as your applications expands to support multiple event versions or special cases.

daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md

+7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ The examples below demonstrate pub/sub messaging between a `checkout` app and an
1919

2020
### Declarative subscriptions
2121

22+
{{% alert title="Note" color="primary" %}}
23+
This feature is currently in preview.
24+
Dapr can be made to "hot reload" declarative subscriptions, whereby updates are picked up automatically without needing a restart.
25+
This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}).
26+
To prevent reprocessing or loss of unprocessed messages, in-flight messages between Dapr and your application are unaffected during hot reload events.
27+
{{% /alert %}}
28+
2229
You can subscribe declaratively to a topic using an external component file. This example uses a YAML component file named `subscription.yaml`:
2330

2431
```yaml

daprdocs/content/en/operations/support/support-preview-features.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ For CLI there is no explicit opt-in, just the version that this was first made a
2222
| **Service invocation for non-Dapr endpoints** | Allow the invocation of non-Dapr endpoints by Dapr using the [Service invocation API]({{< ref service_invocation_api.md >}}). Read ["How-To: Invoke Non-Dapr Endpoints using HTTP"]({{< ref howto-invoke-non-dapr-endpoints.md >}}) for more information. | N/A | [Service invocation API]({{< ref service_invocation_api.md >}}) | v1.11 |
2323
| **Actor State TTL** | Allow actors to save records to state stores with Time To Live (TTL) set to automatically clean up old data. In its current implementation, actor state with TTL may not be reflected correctly by clients, read [Actor State Transactions]({{< ref actors_api.md >}}) for more information. | `ActorStateTTL` | [Actor State Transactions]({{< ref actors_api.md >}}) | v1.11 |
2424
| **Transactional Outbox** | Allows state operations for inserts and updates to be published to a configured pub/sub topic using a single transaction across the state store and the pub/sub | N/A | [Transactional Outbox Feature]({{< ref howto-outbox.md >}}) | v1.12 |
25-
| **Component Hot Reloading** | Allows for Dapr-loaded components to be "hot reloaded". A component spec is reloaded when it is created/updated/deleted in Kubernetes or on file when running in self-hosted mode. Ignores changes to actor state stores and workflow backends. | `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 |
25+
| **Component Hot Reloading** | Allows for Dapr-loaded components to be "hot reloaded". A component spec is reloaded either when it is created/updated/deleted in Kubernetes, or on file in self-hosted mode. Ignores changes to actor state stores and workflow backends. | `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 |
26+
| **Subscription Hot Reloading** | Allows for declarative subscriptions to be "hot reloaded". A subscription is reloaded either when it is created/updated/deleted in Kubernetes, or on file in self-hosted mode. In-flight messages are unaffected when reloading. | `HotReload`| [Hot Reloading]({{< ref "subscription-methods.md#declarative-subscriptions" >}}) | v1.14 |

0 commit comments

Comments
 (0)