mirror of https://github.com/dapr/docs.git
Merge branch 'v1.12' into bulk_pubsub_optimization_paths
This commit is contained in:
commit
67e2befc49
|
@ -14,19 +14,21 @@ In order to implement a pluggable component, you need to implement a gRPC servic
|
|||
|
||||
### Find the proto definition file
|
||||
|
||||
Proto definitions are provided for each supported service interface (state store, pub/sub, bindings).
|
||||
Proto definitions are provided for each supported service interface (state store, pub/sub, bindings, secret stores).
|
||||
|
||||
Currently, the following component APIs are supported:
|
||||
|
||||
- State stores
|
||||
- Pub/sub
|
||||
- Bindings
|
||||
- Secret stores
|
||||
|
||||
| Component | Type | gRPC definition | Built-in Reference Implementation | Docs |
|
||||
| :---------: | :--------: | :--------------: | :----------------------------------------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| State Store | `state` | [state.proto] | [Redis](https://github.com/dapr/components-contrib/tree/master/state/redis) | [concept]({{< ref "state-management-overview" >}}), [howto]({{< ref "howto-get-save-state" >}}), [api spec]({{< ref "state_api" >}}) |
|
||||
| Pub/sub | `pubsub` | [pubsub.proto] | [Redis](https://github.com/dapr/components-contrib/tree/master/pubsub/redis) | [concept]({{< ref "pubsub-overview" >}}), [howto]({{< ref "howto-publish-subscribe" >}}), [api spec]({{< ref "pubsub_api" >}}) |
|
||||
| Bindings | `bindings` | [bindings.proto] | [Kafka](https://github.com/dapr/components-contrib/tree/master/bindings/kafka) | [concept]({{< ref "bindings-overview" >}}), [input howto]({{< ref "howto-triggers" >}}), [output howto]({{< ref "howto-bindings" >}}), [api spec]({{< ref "bindings_api" >}}) |
|
||||
| State Store | `state` | [state.proto](https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/state.proto) | [Redis](https://github.com/dapr/components-contrib/tree/master/state/redis) | [concept]({{< ref "state-management-overview" >}}), [howto]({{< ref "howto-get-save-state" >}}), [api spec]({{< ref "state_api" >}}) |
|
||||
| Pub/sub | `pubsub` | [pubsub.proto](https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/pubsub.proto) | [Redis](https://github.com/dapr/components-contrib/tree/master/pubsub/redis) | [concept]({{< ref "pubsub-overview" >}}), [howto]({{< ref "howto-publish-subscribe" >}}), [api spec]({{< ref "pubsub_api" >}}) |
|
||||
| Bindings | `bindings` | [bindings.proto](https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/bindings.proto) | [Kafka](https://github.com/dapr/components-contrib/tree/master/bindings/kafka) | [concept]({{< ref "bindings-overview" >}}), [input howto]({{< ref "howto-triggers" >}}), [output howto]({{< ref "howto-bindings" >}}), [api spec]({{< ref "bindings_api" >}}) |
|
||||
| Secret Store | `secretstores` | [secretstore.proto](https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/secretstore.proto) | [Hashicorp/Vault](https://github.com/dapr/components-contrib/blob/master/secretstores/hashicorp/vault/vault.go) | [concept]({{< ref "secrets-overview" >}}), [howto-secrets]({{< ref "howto-secrets" >}}), [api spec]({{< ref "secrets_api" >}}) |
|
||||
|
||||
Below is a snippet of the gRPC service definition for pluggable component state stores ([state.proto]):
|
||||
|
||||
|
@ -95,11 +97,15 @@ Provide a concrete implementation of the desired service. Each component has a g
|
|||
|
||||
- **Pub/sub**
|
||||
|
||||
Pluggable pub/sub components only have a single core service interface defined ([pubsub.proto]). They have no optional service interfaces.
|
||||
Pluggable pub/sub components only have a single core service interface defined [pubsub.proto](https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/pubsub.proto). They have no optional service interfaces.
|
||||
|
||||
- **Bindings**
|
||||
|
||||
Pluggable input and output bindings have a single core service definition on [bindings.proto]. They have no optional service interfaces.
|
||||
Pluggable input and output bindings have a single core service definition on [bindings.proto](https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/bindings.proto). They have no optional service interfaces.
|
||||
|
||||
- **Secret Store**
|
||||
|
||||
Pluggable Secret store have a single core service definition on [secretstore.proto](https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/secretstore.proto). They have no optional service interfaces.
|
||||
|
||||
After generating the above state store example's service scaffolding code using gRPC and protocol buffers tools, you can define concrete implementations for the 9 methods defined under `service StateStore`, along with code to initialize and communicate with your dependencies.
|
||||
|
||||
|
|
|
@ -63,7 +63,3 @@ In contrast, pluggable components require additional steps before they can commu
|
|||
|
||||
- [Implement a pluggable component]({{< ref develop-pluggable.md >}})
|
||||
- [Pluggable component registration]({{< ref "pluggable-components-registration" >}})
|
||||
|
||||
[state.proto]: https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/state.proto
|
||||
[pubsub.proto]: https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/pubsub.proto
|
||||
[bindings.proto]: https://github.com/dapr/dapr/blob/master/dapr/proto/components/v1/bindings.proto
|
||||
|
|
|
@ -56,7 +56,7 @@ spec:
|
|||
# value: "5"
|
||||
# - name: publishInitialRetryIntervalInMs # Optional
|
||||
# value: "500"
|
||||
# - name: direction
|
||||
# - name: direction
|
||||
# value: "input, output"
|
||||
```
|
||||
{{% alert title="Warning" color="warning" %}}
|
||||
|
@ -129,6 +129,47 @@ This component supports **output binding** with the following operations:
|
|||
|
||||
- `create`: publishes a message to the specified queue
|
||||
|
||||
## Message metadata
|
||||
|
||||
Azure Service Bus messages extend the Dapr message format with additional contextual metadata. Some metadata fields are set by Azure Service Bus itself (read-only) and others can be set by the client when publishing a message through `Invoke` binding call with `create` operation.
|
||||
|
||||
### Sending a message with metadata
|
||||
|
||||
To set Azure Service Bus metadata when sending a message, set the query parameters on the HTTP request or the gRPC metadata as documented [here]({{< ref "bindings_api.md" >}}).
|
||||
|
||||
- `metadata.MessageId`
|
||||
- `metadata.CorrelationId`
|
||||
- `metadata.SessionId`
|
||||
- `metadata.Label`
|
||||
- `metadata.ReplyTo`
|
||||
- `metadata.PartitionKey`
|
||||
- `metadata.To`
|
||||
- `metadata.ContentType`
|
||||
- `metadata.ScheduledEnqueueTimeUtc`
|
||||
- `metadata.ReplyToSessionId`
|
||||
|
||||
{{% alert title="Note" color="primary" %}}
|
||||
- The `metadata.MessageId` property does not set the `id` property of the cloud event returned by Dapr and should be treated in isolation.
|
||||
- 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.
|
||||
{{% /alert %}}
|
||||
|
||||
### Receiving a message with metadata
|
||||
|
||||
When Dapr calls your application, it attaches Azure Service Bus message metadata to the request using either HTTP headers or gRPC metadata.
|
||||
In addition to the [settable metadata listed above](#sending-a-message-with-metadata), you can also access the following read-only message metadata.
|
||||
|
||||
- `metadata.DeliveryCount`
|
||||
- `metadata.LockedUntilUtc`
|
||||
- `metadata.LockToken`
|
||||
- `metadata.EnqueuedTimeUtc`
|
||||
- `metadata.SequenceNumber`
|
||||
|
||||
To find out more details on the purpose of any of these metadata properties, please refer to [the official Azure Service Bus documentation](https://docs.microsoft.com/rest/api/servicebus/message-headers-and-properties#message-headers).
|
||||
|
||||
{{% alert title="Note" color="primary" %}}
|
||||
All times are populated by the server and are not adjusted for clock skews.
|
||||
{{% /alert %}}
|
||||
|
||||
## Specifying a TTL per message
|
||||
|
||||
Time to live can be defined on a per-queue level (as illustrated above) or at the message level. The value defined at message level overwrites any value set at the queue level.
|
||||
|
|
|
@ -11,7 +11,7 @@ aliases:
|
|||
|
||||
To set up Azure Service Bus Queues pub/sub, create a component of type `pubsub.azure.servicebus.queues`. See the [pub/sub broker component file]({{< ref setup-pubsub.md >}}) to learn how ConsumerID is automatically generated. Read the [How-to: Publish and Subscribe guide]({{< ref "howto-publish-subscribe.md#step-1-setup-the-pubsub-component" >}}) on how to create and apply a pub/sub configuration.
|
||||
|
||||
> This component uses queues on Azure Service Bus; see the official documentation for the differences between [topics and queues](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions).
|
||||
> This component uses queues on Azure Service Bus; see the official documentation for the differences between [topics and queues](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions).
|
||||
> For using topics, see the [Azure Service Bus Topics pubsub component]({{< ref "setup-azure-servicebus-topics" >}}).
|
||||
|
||||
### Connection String Authentication
|
||||
|
@ -122,7 +122,7 @@ Azure Service Bus messages extend the Dapr message format with additional contex
|
|||
|
||||
### Sending a message with metadata
|
||||
|
||||
To set Azure Service Bus metadata when sending a message, set the query parameters on the HTTP request or the gRPC metadata as documented [here](https://docs.dapr.io/reference/api/pubsub_api/#metadata).
|
||||
To set Azure Service Bus metadata when sending a message, set the query parameters on the HTTP request or the gRPC metadata as documented [here]({{< ref "pubsub_api.md#metadata" >}}).
|
||||
|
||||
- `metadata.MessageId`
|
||||
- `metadata.CorrelationId`
|
||||
|
@ -135,13 +135,14 @@ To set Azure Service Bus metadata when sending a message, set the query paramete
|
|||
- `metadata.ScheduledEnqueueTimeUtc`
|
||||
- `metadata.ReplyToSessionId`
|
||||
|
||||
> **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.
|
||||
{{% alert title="Note" color="primary" %}}
|
||||
- The `metadata.MessageId` property does not set the `id` property of the cloud event returned by Dapr and should be treated in isolation.
|
||||
- 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.
|
||||
{{% /alert %}}
|
||||
|
||||
### 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 attaches Azure Service Bus message metadata to the request using either HTTP headers or gRPC metadata.
|
||||
In addition to the [settable metadata listed above](#sending-a-message-with-metadata), you can also access the following read-only message metadata.
|
||||
|
||||
- `metadata.DeliveryCount`
|
||||
|
@ -152,7 +153,9 @@ In addition to the [settable metadata listed above](#sending-a-message-with-meta
|
|||
|
||||
To find out more details on the purpose of any of these metadata properties, please refer to [the official Azure Service Bus documentation](https://docs.microsoft.com/rest/api/servicebus/message-headers-and-properties#message-headers).
|
||||
|
||||
> Note: that all times are populated by the server and are not adjusted for clock skews.
|
||||
{{% alert title="Note" color="primary" %}}
|
||||
All times are populated by the server and are not adjusted for clock skews.
|
||||
{{% /alert %}}
|
||||
|
||||
## Sending and receiving multiple messages
|
||||
|
||||
|
|
Loading…
Reference in New Issue