diff --git a/daprdocs/content/en/operations/components/setup-bindings/supported-bindings/rabbitmq.md b/daprdocs/content/en/operations/components/setup-bindings/supported-bindings/rabbitmq.md index 7bca645e0..b50663b8c 100644 --- a/daprdocs/content/en/operations/components/setup-bindings/supported-bindings/rabbitmq.md +++ b/daprdocs/content/en/operations/components/setup-bindings/supported-bindings/rabbitmq.md @@ -31,6 +31,8 @@ spec: value: 0 - name: exclusive value: false + - name: maxPriority + value: 5 ``` - `queueName` is the RabbitMQ queue name. @@ -40,6 +42,7 @@ spec: - `ttlInSeconds` is an optional parameter to set the [default message time to live at RabbitMQ queue level](https://www.rabbitmq.com/ttl.html). If this parameter is omitted, messages won't expire, continuing to exist on the queue until processed. - `prefetchCount` is an optional parameter to set the [Channel Prefetch Setting (QoS)](https://www.rabbitmq.com/confirms.html#channel-qos-prefetch). If this parameter is omiited, QoS would set value to 0 as no limit. - `exclusive` determines whether the topic will be an exclusive topic or not +- `maxPriority` is an optional parameter to set the [priority queue](https://www.rabbitmq.com/priority.html). If this parameter is omitted, queue will be created as a general queue instead of a priority queue. {{% 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 >}}). @@ -69,6 +72,30 @@ curl -X POST http://localhost:3500/v1.0/bindings/myRabbitMQ \ }' ``` +## Specifying a priority on message level + +Priority can be defined at the message level. If `maxPriority` parameter is set, high priority messages will have priority over other low priority messages. + +To set priority at message level use the `metadata` section in the request body during the binding invocation. + +The field name is `priority`. + +Example: + +```shell +curl -X POST http://localhost:3500/v1.0/bindings/myRabbitMQ \ + -H "Content-Type: application/json" \ + -d '{ + "data": { + "message": "Hi" + }, + "metadata": { + "priority": "5" + }, + "operation": "create" + }' +``` + ## Output Binding Supported Operations * create