diff --git a/daprdocs/content/en/getting-started/get-started-component.md b/daprdocs/content/en/getting-started/get-started-component.md index 69f7ae1ab..ef9d3038a 100644 --- a/daprdocs/content/en/getting-started/get-started-component.md +++ b/daprdocs/content/en/getting-started/get-started-component.md @@ -50,7 +50,7 @@ spec: version: v1 metadata: - name: secretsFile - value: /secrets.json + value: /mysecrets.json - name: nestedSeparator value: ":" ``` diff --git a/daprdocs/content/en/operations/components/component-schema.md b/daprdocs/content/en/operations/components/component-schema.md index b577174d9..b9dc72881 100644 --- a/daprdocs/content/en/operations/components/component-schema.md +++ b/daprdocs/content/en/operations/components/component-schema.md @@ -42,6 +42,31 @@ spec: | spec.ignoreErrors | N | Tells the Dapr sidecar to continue initialization if the component fails to load. Default is false | `false` | **spec.metadata** | - | **A key/value pair of component specific configuration. See your component definition for fields**| +### Special metadata values + +Metadata values can contain a `{uuid}` tag that is replaced with a randomly generate UUID when the Dapr sidecar starts up. A new UUID is generated on every start up. It can be used, for example, to have a pod on Kubernetes with multiple application instances consuming a [shared MQTT subscription]({{< ref "setup-mqtt.md" >}}). Below is an example of using the `{uuid}` tag. + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: messagebus +spec: + type: pubsub.mqtt + version: v1 + metadata: + - name: consumerID + value: "{uuid}" + - name: url + value: "tcp://admin:public@localhost:1883" + - name: qos + value: 1 + - name: retain + value: "false" + - name: cleanSession + value: "false" +``` + ## Further reading - [Components concept]({{< ref components-concept.md >}}) - [Reference secrets in component definitions]({{< ref component-secrets.md >}}) @@ -49,4 +74,4 @@ spec: - [Supported pub/sub brokers]({{< ref supported-pubsub >}}) - [Supported secret stores]({{< ref supported-secret-stores >}}) - [Supported bindings]({{< ref supported-bindings >}}) -- [Set component scopes]({{< ref component-scopes.md >}}) \ No newline at end of file +- [Set component scopes]({{< ref component-scopes.md >}}) diff --git a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-mqtt.md b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-mqtt.md index b15dd231f..98376c11b 100644 --- a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-mqtt.md +++ b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-mqtt.md @@ -54,6 +54,7 @@ metadata: namespace: default spec: type: pubsub.mqtt + version: v1 metadata: - name: url value: "tcps://host.domain[:port]" @@ -71,6 +72,32 @@ spec: value: '' ``` +### Consuming a shared topic + +When consuming a shared topic, each consumer must have a unique identifier. By default, the application Id is used to uniquely identify each consumer and publisher. In self-hosted mode, running each Dapr run with a different application Id is sufficient to have them consume from the same shared topic. However on Kubernetes, a pod with multiple application instances shares the same application Id, prohibiting all instances from consuming the same topic. To overcome this, configure the component's `ConsumerID` metadata with a `{uuid}` tag, making each instance to have a randomly generated `ConsumerID` value on start up. For example: + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: messagebus + namespace: default +spec: + type: pubsub.mqtt + version: v1 + metadata: + - name: consumerID + value: "{uuid}" + - name: url + value: "tcp://admin:public@localhost:1883" + - name: qos + value: 1 + - name: retain + value: "false" + - name: cleanSession + value: "false" +``` + {{% alert title="Warning" color="warning" %}} The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}). {{% /alert %}} @@ -149,4 +176,4 @@ You can then interact with the server using the client port: `tcp://mqtt-broker. ## 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 -- [Pub/Sub building block]({{< ref pubsub >}}) \ No newline at end of file +- [Pub/Sub building block]({{< ref pubsub >}}) diff --git a/daprdocs/content/en/operations/security/oauth.md b/daprdocs/content/en/operations/security/oauth.md index 7a2b32f81..488391361 100644 --- a/daprdocs/content/en/operations/security/oauth.md +++ b/daprdocs/content/en/operations/security/oauth.md @@ -71,6 +71,12 @@ spec: value: "" - name: authHeaderName value: "
" + # forceHTTPS: + # This key is used to set HTTPS schema on redirect to your API method + # after Dapr successfully received Access Token from Identity Provider. + # By default, Dapr will use HTTP on this redirect. + - name: forceHTTPS + value: "" ``` ### Define a custom pipeline for an Authorization Code Grant