From a732ff2fc097c48f99c31d81c6d54f5bb0a9d6e8 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 27 Jun 2023 15:58:48 -0400 Subject: [PATCH 1/5] remove consumerid and add example Signed-off-by: Hannah Hunter --- .../supported-pubsub/setup-jetstream.md | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-jetstream.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-jetstream.md index 6338b3a0cff..51e61b56f66 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-jetstream.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-jetstream.md @@ -31,8 +31,6 @@ spec: value: "/path/to/tls.key" - name: token # Optional. Used for token based authentication. value: "my-token" - - name: consumerID - value: "channel1" - name: name value: "my-conn-name" - name: streamName @@ -83,7 +81,6 @@ spec: | tls_client_cert | N | NATS TLS Client Authentication Certificate | `"/path/to/tls.crt"` | | tls_client_key | N | NATS TLS Client Authentication Key | `"/path/to/tls.key"` | | token | N | [NATS token based authentication] | `"my-token"` | -| consumerID | N | Consumer ID (consumer tag) organizes one or more consumers into a group. Consumers with the same consumer ID work as one virtual consumer; for example, a message is processed only once by one of the consumers in the group. If the `consumerID` is not provided, the Dapr runtime set it to the Dapr application ID (`appID`) value. | `"channel1"` | name | N | NATS connection name | `"my-conn-name"` | | streamName | N | Name of the JetStream Stream to bind to | `"my-stream"` | | durableName | N | [Durable name] | `"my-durable"` | @@ -146,6 +143,31 @@ It is essential to create a NATS JetStream for a specific subject. For example, nats -s localhost:4222 stream add myStream --subjects mySubject ``` +## Example: Competing consumers pattern + +Let's say you'd like each message to be processed by only one application or pod with the same app-id. Typically, the `consumerID` metadata spec helps you define competing consumers. However, `consumerID` is not supported in NATS JetStream. + +The following example demonstrates using a competing consumer pattern with dynamic values. + +```yml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: pubsub +spec: + type: pubsub.jetstream + version: v1 + metadata: + - name: name + value: "my-conn-name" + - name: streamName + value: "my-stream" + - name: durableName + value: "my-durable" + - name: queueGroupName + value: "my-queue" +``` + ## Related links - [Basic schema for a Dapr component]({{< ref component-schema >}}) - Read [this guide]({{< ref "howto-publish-subscribe.md#step-2-publish-a-topic" >}}) for instructions on configuring pub/sub components From 9068813b09b6eee8e5ffa1ab59ab54da9eebf39c Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Wed, 5 Jul 2023 12:21:19 -0400 Subject: [PATCH 2/5] updates from @jarema Signed-off-by: Hannah Hunter --- .../supported-pubsub/setup-jetstream.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-jetstream.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-jetstream.md index 51e61b56f66..cfb88b1b032 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-jetstream.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-jetstream.md @@ -36,9 +36,9 @@ spec: - name: streamName value: "my-stream" - name: durableName - value: "my-durable" + value: "my-durable-subscription" - name: queueGroupName - value: "my-queue" + value: "my-queue-group" - name: startSequence value: 1 - name: startTime # In Unix format @@ -145,9 +145,9 @@ nats -s localhost:4222 stream add myStream --subjects mySubject ## Example: Competing consumers pattern -Let's say you'd like each message to be processed by only one application or pod with the same app-id. Typically, the `consumerID` metadata spec helps you define competing consumers. However, `consumerID` is not supported in NATS JetStream. +Let's say you'd like each message to be processed by only one application or pod with the same app-id. Typically, the `consumerID` metadata spec helps you define competing consumers. -The following example demonstrates using a competing consumer pattern with dynamic values. +Since `consumerID` is not supported in NATS JetStream, you need to specify `durableName` and `queueGroupName` to achieve the competing consumers pattern. For example: ```yml apiVersion: dapr.io/v1alpha1 @@ -163,9 +163,9 @@ spec: - name: streamName value: "my-stream" - name: durableName - value: "my-durable" + value: "my-durable-subscription" - name: queueGroupName - value: "my-queue" + value: "my-queue-group" ``` ## Related links From 844816712e9c4f1e286edf8363a4a179e65b45c3 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Wed, 5 Jul 2023 16:09:23 -0400 Subject: [PATCH 3/5] add note about dynamic subscriptions Signed-off-by: Hannah Hunter --- .../building-blocks/pubsub/subscription-methods.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 52747ce9f03..61ee824658c 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 @@ -187,7 +187,11 @@ The `/checkout` endpoint matches the `route` defined in the subscriptions and th ### Programmatic subscriptions -The programmatic approach returns the `routes` JSON structure within the code, unlike the declarative approach's `route` YAML structure. In the example below, you define the values found in the [declarative YAML subscription](#declarative-subscriptions) above within the application code. +The dynamic programmatic approach returns the `routes` JSON structure within the code, unlike the declarative approach's `route` YAML structure. + +> **Note:** Dynamic subscriptions are only read once during application start-up. + +In the example below, you define the values found in the [declarative YAML subscription](#declarative-subscriptions) above within the application code. {{< tabs ".NET" Java Python JavaScript Go>}} From b149edb9f2108b70366be9e63edfeaf4c8af19b2 Mon Sep 17 00:00:00 2001 From: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:14:20 -0400 Subject: [PATCH 4/5] Update daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md Co-authored-by: Mark Fussell Signed-off-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> --- .../building-blocks/pubsub/subscription-methods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 61ee824658c..dce9cbd9a14 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 @@ -189,7 +189,7 @@ The `/checkout` endpoint matches the `route` defined in the subscriptions and th The dynamic programmatic approach returns the `routes` JSON structure within the code, unlike the declarative approach's `route` YAML structure. -> **Note:** Dynamic subscriptions are only read once during application start-up. +> **Note:** Programmatic subscriptions are only read once during application start-up. You cannot _dynamically_ add new programmatic subscriptions, only at new ones at compile time. In the example below, you define the values found in the [declarative YAML subscription](#declarative-subscriptions) above within the application code. From 3889aa28165aadce0a491dde3d81b50c6eb28360 Mon Sep 17 00:00:00 2001 From: Yaron Schneider Date: Mon, 10 Jul 2023 22:47:44 -0700 Subject: [PATCH 5/5] Update kubernetes-upgrade.md Signed-off-by: Yaron Schneider --- .../en/operations/hosting/kubernetes/kubernetes-upgrade.md | 1 + 1 file changed, 1 insertion(+) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-upgrade.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-upgrade.md index f62624bc628..e9bbb0c13a9 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-upgrade.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-upgrade.md @@ -66,6 +66,7 @@ From version 1.0.0 onwards, upgrading Dapr using Helm is no longer a disruptive kubectl replace -f https://raw.githubusercontent.com/dapr/dapr/v{{% dapr-latest-version long="true" %}}/charts/dapr/crds/configuration.yaml kubectl replace -f https://raw.githubusercontent.com/dapr/dapr/v{{% dapr-latest-version long="true" %}}/charts/dapr/crds/subscription.yaml kubectl apply -f https://raw.githubusercontent.com/dapr/dapr/v{{% dapr-latest-version long="true" %}}/charts/dapr/crds/resiliency.yaml + kubectl apply -f https://raw.githubusercontent.com/dapr/dapr/v{{% dapr-latest-version long="true" %}}/charts/dapr/crds/httpendpoints.yaml ``` ```bash