From c7a43e5d5db4f7b8cc6bc5feebad7be0fc1b8778 Mon Sep 17 00:00:00 2001 From: Trond Hindenes Date: Sun, 3 Jan 2021 16:52:58 +0100 Subject: [PATCH 1/5] updated rabbitmq documentation --- .../supported-pubsub/setup-rabbitmq.md | 81 +++++++++++-------- 1 file changed, 47 insertions(+), 34 deletions(-) diff --git a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md index f363fd565..b34f50f96 100644 --- a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md +++ b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md @@ -5,7 +5,53 @@ linkTitle: "RabbitMQ" description: "Detailed documentation on the RabbitMQ pubsub component" --- -## Setup RabbitMQ +## Format + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: rabbitmq-pubsub + namespace: default +spec: + type: pubsub.rabbitmq + version: v1 + metadata: + - name: host + value: "amqp://localhost:5672" + - name: durable + value: "false" + - name: deletedWhenUnused + value: "false" + - name: autoAck + value: "false" + - name: deliveryMode + value: "0" + - name: requeueInFailure + value: "false" + - name: prefetchCount + value: "0" +``` +{{% 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 %}} + +## Fields + +| Field | Required | Details | Example | +|--------------------|:--------:|---------|---------| +| host | Y | Connection-string for the rabbitmq host | `amqp://user:pass@localhost:5672` +| durable | N | Whether or not to use [durable](https://www.rabbitmq.com/queues.html#durability) queues. Defaults to `"false"` | `"true"`, `"false"` +| deletedWhenUnused | N | Whether or not the queue sohuld be configured to [auto-delete](https://www.rabbitmq.com/queues.html) Defaults to `"false"` | `"true"`, `"false"` +| autoAck | N | Whether or not the queue consumer should [auto-ack](https://www.rabbitmq.com/confirms.html) messages. Defaults to `"false"` | `"true"`, `"false"` +| deliveryMode | N | Persistence mode when publishing messages. Defaults to `"0"`. RabbitMQ treats `"2"` as persistent, all other numbers as non-persistent | `"0"`, `"2"` +| requeueInFailure | N | Whether or not to requeue when sending a [negative acknolwedgement](https://www.rabbitmq.com/nack.html) in case of a failure. Defaults to `"false"` | `"true"`, `"false"` +| prefetchCount | N | Number of messages to [prefecth](https://www.rabbitmq.com/consumer-prefetch.html). Consider changing this to a non-zero value for production environments. Defaults to `"0"`, which means that all available messages will be prefected. | `"2"` +| reconnectWait | N | How long to wait (in seconds) before reconnecting if a connection failure occurs | `"0"` + +## Further reading + +### How to set up RabbitMQ {{< tabs "Self-Hosted" "Kubernetes" >}} @@ -38,39 +84,6 @@ For example, if installing using the example above, the RabbitMQ server client a {{< /tabs >}} -## Create a Dapr component - -The next step is to create a Dapr component for RabbitMQ. - -Create the following YAML file named `rabbitmq.yaml`: - -```yaml -apiVersion: dapr.io/v1alpha1 -kind: Component -metadata: - name: - namespace: -spec: - type: pubsub.rabbitmq - version: v1 - metadata: - - name: host - value: # Required. Example: "amqp://rabbitmq.default.svc.cluster.local:5672", "amqp://localhost:5672" - - name: durable - value: # Optional. Default: "false" - - name: deletedWhenUnused - value: # Optional. Default: "false" - - name: autoAck - value: # Optional. Default: "false" - - name: deliveryMode - value: # Optional. Default: "0". Values between 0 - 2. - - name: requeueInFailure - value: # Optional. Default: "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 %}} ## Apply the configuration From e3e2783ba89a01ee1dd235265141b64ce5c4c80e Mon Sep 17 00:00:00 2001 From: Trond Hindenes Date: Mon, 4 Jan 2021 13:35:32 +0100 Subject: [PATCH 2/5] Added reconnectWait to yaml spec --- .../components/setup-pubsub/supported-pubsub/setup-rabbitmq.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md index b34f50f96..2e2f8d8a1 100644 --- a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md +++ b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md @@ -31,6 +31,8 @@ spec: value: "false" - name: prefetchCount value: "0" + - name: reconnectWait + value: "0" ``` {{% 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 >}}). From efaf109069ee6ad0c9263e50fceb530014679e6f Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Tue, 12 Jan 2021 21:34:57 -0800 Subject: [PATCH 3/5] Update setup-rabbitmq.md --- .../supported-pubsub/setup-rabbitmq.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md index 2e2f8d8a1..2efffba24 100644 --- a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md +++ b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md @@ -5,7 +5,7 @@ linkTitle: "RabbitMQ" description: "Detailed documentation on the RabbitMQ pubsub component" --- -## Format +## Component format ```yaml apiVersion: dapr.io/v1alpha1 @@ -38,7 +38,7 @@ spec: 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 %}} -## Fields +## Spec metadata fields | Field | Required | Details | Example | |--------------------|:--------:|---------|---------| @@ -51,9 +51,8 @@ The above example uses secrets as plain strings. It is recommended to use a secr | prefetchCount | N | Number of messages to [prefecth](https://www.rabbitmq.com/consumer-prefetch.html). Consider changing this to a non-zero value for production environments. Defaults to `"0"`, which means that all available messages will be prefected. | `"2"` | reconnectWait | N | How long to wait (in seconds) before reconnecting if a connection failure occurs | `"0"` -## Further reading -### How to set up RabbitMQ +## Create a RabbitMQ server {{< tabs "Self-Hosted" "Kubernetes" >}} @@ -87,9 +86,7 @@ For example, if installing using the example above, the RabbitMQ server client a {{< /tabs >}} -## Apply the configuration - -Visit [this guide]({{< ref "howto-publish-subscribe.md#step-2-publish-a-topic" >}}) for instructions on configuring pub/sub components. - ## Related links -- [Pub/Sub building block]({{< ref pubsub >}}) \ No newline at end of file +- [Basic schema for a Dapr component]({{< ref component-schema >}}) in the Related links section +- Read [this topic]({{< ref "howto-publish-subscribe.md#step-2-publish-a-topic" >}}) for instructions on configuring pub/sub components +- [Pub/Sub building block]({{< ref pubsub >}}) From c36ac56cadfb9c43a15cfeecb007e674f251c3f4 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Tue, 12 Jan 2021 21:38:39 -0800 Subject: [PATCH 4/5] Update setup-rabbitmq.md --- .../components/setup-pubsub/supported-pubsub/setup-rabbitmq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md index 2efffba24..80a87b3a8 100644 --- a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md +++ b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md @@ -88,5 +88,5 @@ For example, if installing using the example above, the RabbitMQ server client a ## Related links - [Basic schema for a Dapr component]({{< ref component-schema >}}) in the Related links section -- Read [this topic]({{< ref "howto-publish-subscribe.md#step-2-publish-a-topic" >}}) for instructions on configuring pub/sub components +- 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 >}}) From 197fb9ea13bd851c59cc9d39a035c83555491cd4 Mon Sep 17 00:00:00 2001 From: Trond Hindenes Date: Wed, 13 Jan 2021 11:44:11 +0100 Subject: [PATCH 5/5] Added concurrency setting documentation --- .../setup-pubsub/supported-pubsub/setup-rabbitmq.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md index 80a87b3a8..b6a50913b 100644 --- a/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md +++ b/daprdocs/content/en/operations/components/setup-pubsub/supported-pubsub/setup-rabbitmq.md @@ -33,6 +33,8 @@ spec: value: "0" - name: reconnectWait value: "0" + - name: concurrency + value: parallel ``` {{% 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 >}}). @@ -48,8 +50,9 @@ The above example uses secrets as plain strings. It is recommended to use a secr | autoAck | N | Whether or not the queue consumer should [auto-ack](https://www.rabbitmq.com/confirms.html) messages. Defaults to `"false"` | `"true"`, `"false"` | deliveryMode | N | Persistence mode when publishing messages. Defaults to `"0"`. RabbitMQ treats `"2"` as persistent, all other numbers as non-persistent | `"0"`, `"2"` | requeueInFailure | N | Whether or not to requeue when sending a [negative acknolwedgement](https://www.rabbitmq.com/nack.html) in case of a failure. Defaults to `"false"` | `"true"`, `"false"` -| prefetchCount | N | Number of messages to [prefecth](https://www.rabbitmq.com/consumer-prefetch.html). Consider changing this to a non-zero value for production environments. Defaults to `"0"`, which means that all available messages will be prefected. | `"2"` +| prefetchCount | N | Number of messages to [prefecth](https://www.rabbitmq.com/consumer-prefetch.html). Consider changing this to a non-zero value for production environments. Defaults to `"0"`, which means that all available messages will be pre-fetched. | `"2"` | reconnectWait | N | How long to wait (in seconds) before reconnecting if a connection failure occurs | `"0"` +| concurrency | N | `paralell` is the default, and allows processing multiple messages in paralell (limited by the `app-max-concurrency` annotation, if configured). Set to `single` to disable paralell processing. In most situations there's no reason to change this. | `paralell`, `single` ## Create a RabbitMQ server