mirror of https://github.com/dapr/docs.git
updates from mark pt 1
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
parent
6a92317f33
commit
55a9c26ab6
|
@ -25,13 +25,14 @@ The diagram below is an example of how dead letter topics work. First a message
|
||||||
The following YAML shows how to configure a subscription with a dead letter topic named `poisonMessages` for messages consumed from the `orders` topic. This subscription is scoped to an app with a `checkout` ID.
|
The following YAML shows how to configure a subscription with a dead letter topic named `poisonMessages` for messages consumed from the `orders` topic. This subscription is scoped to an app with a `checkout` ID.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v2alpha1
|
||||||
kind: Subscription
|
kind: Subscription
|
||||||
metadata:
|
metadata:
|
||||||
name: order
|
name: order
|
||||||
spec:
|
spec:
|
||||||
topic: orders
|
topic: orders
|
||||||
route: /checkout
|
routes:
|
||||||
|
default: /checkout
|
||||||
pubsubname: pubsub
|
pubsubname: pubsub
|
||||||
deadLetterTopic: poisonMessages
|
deadLetterTopic: poisonMessages
|
||||||
scopes:
|
scopes:
|
||||||
|
@ -86,13 +87,16 @@ spec:
|
||||||
Remember to now configure a subscription to handling the dead letter topics. For example you can create another declarative subscription to receive these on the same or a different application. The example below shows the checkout application subscribing to the `poisonMessages` topic with another subscription and sending these to be handled by the `/failedmessages` endpoint.
|
Remember to now configure a subscription to handling the dead letter topics. For example you can create another declarative subscription to receive these on the same or a different application. The example below shows the checkout application subscribing to the `poisonMessages` topic with another subscription and sending these to be handled by the `/failedmessages` endpoint.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v2alpha1
|
||||||
kind: Subscription
|
kind: Subscription
|
||||||
metadata:
|
metadata:
|
||||||
name: deadlettertopics
|
name: deadlettertopics
|
||||||
spec:
|
spec:
|
||||||
topic: poisonMessages
|
topic: poisonMessages
|
||||||
route: /failedMessages
|
routes:
|
||||||
|
rules:
|
||||||
|
- match:
|
||||||
|
path: /failedMessages
|
||||||
pubsubname: pubsub
|
pubsubname: pubsub
|
||||||
scopes:
|
scopes:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
|
@ -141,13 +141,14 @@ $app->start();
|
||||||
Similarly, you can subscribe to raw events declaratively by adding the `rawPayload` metadata entry to your subscription specification.
|
Similarly, you can subscribe to raw events declaratively by adding the `rawPayload` metadata entry to your subscription specification.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v2alpha1
|
||||||
kind: Subscription
|
kind: Subscription
|
||||||
metadata:
|
metadata:
|
||||||
name: myevent-subscription
|
name: myevent-subscription
|
||||||
spec:
|
spec:
|
||||||
topic: deathStarStatus
|
topic: deathStarStatus
|
||||||
route: /dsstatus
|
routes:
|
||||||
|
default: /dsstatus
|
||||||
pubsubname: pubsub
|
pubsubname: pubsub
|
||||||
metadata:
|
metadata:
|
||||||
rawPayload: "true"
|
rawPayload: "true"
|
||||||
|
|
|
@ -22,13 +22,14 @@ The examples below demonstrate pub/sub messaging between a `checkout` app and an
|
||||||
You can subscribe declaratively to a topic using an external component file. This example uses a YAML component file named `subscription.yaml`:
|
You can subscribe declaratively to a topic using an external component file. This example uses a YAML component file named `subscription.yaml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v2alpha1
|
||||||
kind: Subscription
|
kind: Subscription
|
||||||
metadata:
|
metadata:
|
||||||
name: order
|
name: order
|
||||||
spec:
|
spec:
|
||||||
topic: orders
|
topic: orders
|
||||||
route: /checkout
|
routes:
|
||||||
|
default: /checkout
|
||||||
pubsubname: pubsub
|
pubsubname: pubsub
|
||||||
scopes:
|
scopes:
|
||||||
- orderprocessing
|
- orderprocessing
|
||||||
|
|
|
@ -6,22 +6,24 @@ weight: 3000
|
||||||
description: "The basic spec for a Dapr resiliency resource"
|
description: "The basic spec for a Dapr resiliency resource"
|
||||||
---
|
---
|
||||||
|
|
||||||
The `Resiliency` Dapr resource allows you to define and apply fault tolerance resiliency polcies. Resiliency specs are applied with the Dapr sidecar starts.
|
The `Resiliency` Dapr resource allows you to define and apply fault tolerance resiliency policies. Resiliency specs are applied when the Dapr sidecar starts.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Resiliency
|
kind: Resiliency
|
||||||
metadata:
|
metadata:
|
||||||
name: <REPLACE-WITH-RESOURCE-NAME>
|
name: <REPLACE-WITH-RESOURCE-NAME>
|
||||||
|
version: v1alpha1
|
||||||
scopes:
|
scopes:
|
||||||
- <REPLACE-WITH-SCOPED-APPIDS>
|
- <REPLACE-WITH-SCOPED-APPIDS>
|
||||||
spec:
|
spec:
|
||||||
policies: # Required
|
policies: # Required
|
||||||
timeouts: # Replce with any unique name
|
timeouts: # Replace with any unique name
|
||||||
timeoutName: <REPLACE-WITH-TIME-VALUE>
|
timeoutName: <REPLACE-WITH-TIME-VALUE>
|
||||||
retries:
|
retries:
|
||||||
retryName: # Replace with any unique name
|
retryName: # Replace with any unique name
|
||||||
policy: exponential
|
policy: <REPLACE-WITH-VALUE>
|
||||||
|
duration: <REPLACE-WITH-VALUE>
|
||||||
maxInterval: <REPLACE-WITH-VALUE>
|
maxInterval: <REPLACE-WITH-VALUE>
|
||||||
maxRetries: <REPLACE-WITH-VALUE>
|
maxRetries: <REPLACE-WITH-VALUE>
|
||||||
circuitBreakers:
|
circuitBreakers:
|
||||||
|
@ -53,8 +55,9 @@ targets: # Required
|
||||||
|
|
||||||
| Field | Required | Details | Example |
|
| Field | Required | Details | Example |
|
||||||
|--------------------|:--------:|---------|---------|
|
|--------------------|:--------:|---------|---------|
|
||||||
| policies | Y | The configuration of resiliency policies, including: <br><ul><li>`timeouts`</li><li>`retries`</li><li>`circuitBreakers`</li></ul> | timeout: `general`<br>retry: `retryForever`<br>circuit breaker: `simpleCB` |
|
| policies | Y | The configuration of resiliency policies, including: <br><ul><li>`timeouts`</li><li>`retries`</li><li>`circuitBreakers`</li></ul> <br> [See more examples with all of the built-in policies]({{< ref policies.md >}}) | timeout: `general`<br>retry: `retryForever`<br>circuit breaker: `simpleCB` |
|
||||||
| targets | Y | The configuration for the applications, actors, or components that use the resiliency policies. | |
|
| targets | Y | The configuration for the applications, actors, or components that use the resiliency policies. <br>[See more examples in the resiliency targets guide]({{< ref targets.md >}}) | `apps` <br>`components`<br>`actors` |
|
||||||
|
|
||||||
|
|
||||||
## Related links
|
## Related links
|
||||||
[Learn more about resiliency policies and targets]({{< ref resiliency-overview.md >}})
|
[Learn more about resiliency policies and targets]({{< ref resiliency-overview.md >}})
|
|
@ -6,44 +6,14 @@ weight: 2000
|
||||||
description: "The basic spec for a Dapr subscription"
|
description: "The basic spec for a Dapr subscription"
|
||||||
---
|
---
|
||||||
|
|
||||||
The `Subscription` Dapr resource allows you to subscribe declaratively to a topic using an external component YAML file.
|
The `Subscription` Dapr resource allows you to subscribe declaratively to a topic using an external component YAML file. This guide demonstrates two subscription API versions:
|
||||||
|
|
||||||
## `v1alpha1`
|
- `v2alpha` (default spec)
|
||||||
|
- `v1alpha1` (deprecated)
|
||||||
The following is the basic version `v1alpha1` spec for a `Subscription` resource.
|
|
||||||
|
|
||||||
```yml
|
|
||||||
apiVersion: dapr.io/v1alpha1
|
|
||||||
kind: Subscription
|
|
||||||
metadata:
|
|
||||||
name: <REPLACE-WITH-RESOURCE-NAME>
|
|
||||||
spec:
|
|
||||||
version: v1alpha1
|
|
||||||
topic: <REPLACE-WITH-TOPIC-NAME> # Required
|
|
||||||
route: <REPLACE-WITH-ROUTE-NAME> # Required
|
|
||||||
pubsubname: <REPLACE-WITH-PUBSUB-NAME> # Required
|
|
||||||
deadLetterTopic: <REPLACE-WITH-DEAD-LETTER-TOPIC-NAME> # Optional
|
|
||||||
bulkSubscribe: # Optional
|
|
||||||
- enabled: <REPLACE-WITH-BOOLEAN-VALUE>
|
|
||||||
- maxmessages: <REPLACE-WITH-VALUE>
|
|
||||||
- maxawaitduration: <REPLACE-WITH-VALUE>
|
|
||||||
scopes:
|
|
||||||
- <REPLACE-WITH-SCOPED-APPIDS>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Spec fields
|
|
||||||
|
|
||||||
| Field | Required | Details | Example |
|
|
||||||
|--------------------|:--------:|---------|---------|
|
|
||||||
| topic | Y | The name of the topic to which your component subscribes. | `orders` |
|
|
||||||
| route | Y | The endpoint to which all topic messages are sent. | `/checkout` |
|
|
||||||
| pubsubname | N | The name of your pub/sub component. | `pubsub` |
|
|
||||||
| deadlettertopic | N | The name of the dead letter topic that forwards undeliverable messages. | `poisonMessages` |
|
|
||||||
| bulksubscribe | N | Enable bulk subscribe properties. | `true`, `false` |
|
|
||||||
|
|
||||||
## `v2alpha1`
|
## `v2alpha1`
|
||||||
|
|
||||||
The following the basic `v2alpha1` spec for a `Subscription` resource.
|
The following is the basic `v2alpha1` spec for a `Subscription` resource. `v2alpha1` is the default spec for the subscription API.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
apiVersion: dapr.io/v2alpha1
|
apiVersion: dapr.io/v2alpha1
|
||||||
|
@ -78,6 +48,39 @@ scopes:
|
||||||
| bulksubscribe | N | Enable bulk subscribe properties. | `true`, `false` |
|
| bulksubscribe | N | Enable bulk subscribe properties. | `true`, `false` |
|
||||||
|
|
||||||
|
|
||||||
|
## `v1alpha1`
|
||||||
|
|
||||||
|
The following is the basic version `v1alpha1` spec for a `Subscription` resource. `v1alpha1` is now deprecated.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
apiVersion: dapr.io/v1alpha1
|
||||||
|
kind: Subscription
|
||||||
|
metadata:
|
||||||
|
name: <REPLACE-WITH-RESOURCE-NAME>
|
||||||
|
spec:
|
||||||
|
version: v1alpha1
|
||||||
|
topic: <REPLACE-WITH-TOPIC-NAME> # Required
|
||||||
|
route: <REPLACE-WITH-ROUTE-NAME> # Required
|
||||||
|
pubsubname: <REPLACE-WITH-PUBSUB-NAME> # Required
|
||||||
|
deadLetterTopic: <REPLACE-WITH-DEAD-LETTER-TOPIC-NAME> # Optional
|
||||||
|
bulkSubscribe: # Optional
|
||||||
|
- enabled: <REPLACE-WITH-BOOLEAN-VALUE>
|
||||||
|
- maxmessages: <REPLACE-WITH-VALUE>
|
||||||
|
- maxawaitduration: <REPLACE-WITH-VALUE>
|
||||||
|
scopes:
|
||||||
|
- <REPLACE-WITH-SCOPED-APPIDS>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Spec fields
|
||||||
|
|
||||||
|
| Field | Required | Details | Example |
|
||||||
|
|--------------------|:--------:|---------|---------|
|
||||||
|
| topic | Y | The name of the topic to which your component subscribes. | `orders` |
|
||||||
|
| route | Y | The endpoint to which all topic messages are sent. | `/checkout` |
|
||||||
|
| pubsubname | N | The name of your pub/sub component. | `pubsub` |
|
||||||
|
| deadlettertopic | N | The name of the dead letter topic that forwards undeliverable messages. | `poisonMessages` |
|
||||||
|
| bulksubscribe | N | Enable bulk subscribe properties. | `true`, `false` |
|
||||||
|
|
||||||
## Related links
|
## Related links
|
||||||
- [Learn more about the declarative subscription method]({{< ref "subscription-methods.md#declarative-subscriptions" >}})
|
- [Learn more about the declarative subscription method]({{< ref "subscription-methods.md#declarative-subscriptions" >}})
|
||||||
- [Learn more about dead letter topics]({{< ref pubsub-deadletter.md >}})
|
- [Learn more about dead letter topics]({{< ref pubsub-deadletter.md >}})
|
||||||
|
|
|
@ -90,9 +90,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/ansi-regex": {
|
"node_modules/ansi-regex": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
|
Loading…
Reference in New Issue