add timestamp formates for scheduleenqeueutimeutc

Signed-off-by: fabistb <fabian0401@online.de>
This commit is contained in:
fabistb 2023-06-21 21:40:10 +02:00
parent b1763bf3b9
commit 6c29d7a0dd
3 changed files with 34 additions and 0 deletions

View File

@ -153,6 +153,36 @@ curl -X POST http://localhost:3500/v1.0/bindings/myServiceBusQueue \
{{< /tabs >}} {{< /tabs >}}
## Scheduled messages
A message can be scheduled for delayed processing.
To set schedule a message use the `metadata` section in the request body during the binding invocation: the filed name is `ScheduledEnqueueTimeUtc`.
The supported timestamp formats are [RFC1123](https://www.rfc-editor.org/rfc/rfc1123) and [RFC3339](https://www.rfc-editor.org/rfc/rfc3339).
{{< tabs "Linux">}}
{{% codetab %}}
```shell
curl -X POST http://localhost:3500/v1.0/bindings/myServiceBusQueue \
-H "Content-Type: application/json" \
-d '{
"data": {
"message": "Hi"
},
"metadata": {
"ScheduledEnqueueTimeUtc": "Tue, 02 Jan 2024 15:04:05 GMT"
},
"operation": "create"
}'
```
{{% /codetab %}}
{{< /tabs >}}
## Related links ## Related links
- [Basic schema for a Dapr component]({{< ref component-schema >}}) - [Basic schema for a Dapr component]({{< ref component-schema >}})

View File

@ -137,6 +137,8 @@ To set Azure Service Bus metadata when sending a message, set the query paramete
> **Note:** The `metadata.MessageId` property does not set the `id` property of the cloud event returned by Dapr and should be treated in isolation. > **Note:** The `metadata.MessageId` property does not set the `id` property of the cloud event returned by Dapr and should be treated in isolation.
> **Note:** The `metadata.ScheduledEnqueueTimeUtc` property supports the [RFC1123](https://www.rfc-editor.org/rfc/rfc1123) and [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) timestamp formats.
### Receiving a message with metadata ### Receiving a message with metadata
When Dapr calls your application, it will attach Azure Service Bus message metadata to the request using either HTTP headers or gRPC metadata. When Dapr calls your application, it will attach Azure Service Bus message metadata to the request using either HTTP headers or gRPC metadata.

View File

@ -142,6 +142,8 @@ To set Azure Service Bus metadata when sending a message, set the query paramete
> **NOTE:** If the `metadata.SessionId` property is not set but the topic requires sessions then an empty session id will be used. > **NOTE:** If the `metadata.SessionId` property is not set but the topic requires sessions then an empty session id will be used.
> **NOTE:** The `metadata.ScheduledEnqueueTimeUtc` property supports the [RFC1123](https://www.rfc-editor.org/rfc/rfc1123) and [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) timestamp formats.
### Receiving a message with metadata ### Receiving a message with metadata
When Dapr calls your application, it will attach Azure Service Bus message metadata to the request using either HTTP headers or gRPC metadata. When Dapr calls your application, it will attach Azure Service Bus message metadata to the request using either HTTP headers or gRPC metadata.