diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md index ad0bce8f934..0e53ba46906 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md @@ -184,6 +184,13 @@ The example above shows an event subscription to topic `orders`, for the pubsub Place `subscription.yaml` in the same directory as your `pubsub.yaml` component. When Dapr starts up, it loads subscriptions along with the components. +{{% alert title="Note" color="primary" %}} +This feature is currently in preview. +Dapr can be made to "hot reload" declarative subscriptions, whereby updates are picked up automatically without needing a restart. +This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}). +To prevent reprocessing or loss of unprocessed messages, in-flight messages between Dapr and your application are unaffected during hot reload events. +{{% /alert %}} + Below are code examples that leverage Dapr SDKs to subscribe to the topic you defined in `subscription.yaml`. {{< tabs Dotnet Java Python Go JavaScript>}} diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-overview.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-overview.md index 041dcec8b82..a73f507a894 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-overview.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-overview.md @@ -84,6 +84,13 @@ Dapr applications can subscribe to published topics via two methods that support For more information, read [about the subscriptions in Subscription Methods]({{< ref subscription-methods.md >}}). +### Reloading topic subscriptions + +To reload topic subscriptions that are defined programmatically or declaratively, the Dapr sidecar needs to be restarted. +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" >}}). +Hot reloading of topic subscriptions is currently a preview feature. +In-flight messages are unaffected when reloading a subscription. + ### Message routing 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. diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md index 0b9e2ca2b35..0bf43e4239e 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md @@ -19,6 +19,13 @@ The examples below demonstrate pub/sub messaging between a `checkout` app and an ### Declarative subscriptions +{{% alert title="Note" color="primary" %}} +This feature is currently in preview. +Dapr can be made to "hot reload" declarative subscriptions, whereby updates are picked up automatically without needing a restart. +This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}). +To prevent reprocessing or loss of unprocessed messages, in-flight messages between Dapr and your application are unaffected during hot reload events. +{{% /alert %}} + You can subscribe declaratively to a topic using an external component file. This example uses a YAML component file named `subscription.yaml`: ```yaml diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index 1693971e44c..e975b3be1e6 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -22,4 +22,5 @@ For CLI there is no explicit opt-in, just the version that this was first made a | **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 | | **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 | | **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 | -| **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 | +| **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 | +| **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 |