Skip to content

Commit

Permalink
HotReload: Subscription feature preview
Browse files Browse the repository at this point in the history
Document Declarative Subscription hot reloading preview feature from
dapr/dapr#7583

Signed-off-by: joshvanl <[email protected]>
  • Loading branch information
JoshVanL committed Apr 18, 2024
1 parent 516e503 commit 2ffc074
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}}
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" >}}).
In-flight messages between Dapr and your application will be unaffected during hot reload events to prevent re-processing or loss of unprocessed messages.
This feature is currently in preview.
{{% /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>}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ The examples below demonstrate pub/sub messaging between a `checkout` app and an

### Declarative subscriptions

{{% alert title="Note" color="primary" %}}
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" >}}).
In-flight messages between Dapr and your application will be unaffected during hot reload events to prevent re-processing or loss of unprocessed messages.
This feature is currently in preview.
{{% /alert %}}

You can subscribe declaratively to a topic using an external component file. This example uses a YAML component file named `subscription.yaml`:

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 when it is created/updated/deleted when running 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 |
| **Subscription Hot Reloading** | Allows for declarative Subscriptions to be "hot reloaded". A subscription is reloaded when it is created/updated/deleted when running in Kubernetes or on file when running in self-hosted mode. In-flight messages are unaffected when reloading. | `HotReload`| [Hot Reloading]({{< ref "subscription-methods.md#declarative-subscriptions" >}}) | v1.14 |

0 comments on commit 2ffc074

Please sign in to comment.