mirror of https://github.com/dapr/docs.git
Merge branch 'master' into use-cases
This commit is contained in:
commit
ebff35e59b
|
@ -36,6 +36,8 @@ Every binding has its own unique set of properties. Click the name link to see t
|
||||||
| [AWS S3](../../reference/specs/bindings/s3.md) | | ✅ | Experimental |
|
| [AWS S3](../../reference/specs/bindings/s3.md) | | ✅ | Experimental |
|
||||||
| [AWS SNS](../../reference/specs/bindings/sns.md) | | ✅ | Experimental |
|
| [AWS SNS](../../reference/specs/bindings/sns.md) | | ✅ | Experimental |
|
||||||
| [AWS SQS](../../reference/specs/bindings/sqs.md) | ✅ | ✅ | Experimental |
|
| [AWS SQS](../../reference/specs/bindings/sqs.md) | ✅ | ✅ | Experimental |
|
||||||
|
| [AWS Kinesis](../../reference/specs/bindings/kinesis.md) | ✅ | ✅ | Experimental |
|
||||||
|
|
||||||
|
|
||||||
### Google Cloud Platform (GCP)
|
### Google Cloud Platform (GCP)
|
||||||
|
|
||||||
|
|
|
@ -42,5 +42,11 @@ curl -X POST -H http://localhost:3500/v1.0/bindings/myEvent -d '{ "data": { "me
|
||||||
```
|
```
|
||||||
|
|
||||||
As seen above, we invoked the `/binding` endpoint with the name of the binding to invoke, in our case its `myEvent`.
|
As seen above, we invoked the `/binding` endpoint with the name of the binding to invoke, in our case its `myEvent`.
|
||||||
|
The payload goes inside the mandatory `data` field, and can be any JSON serializable value.
|
||||||
|
|
||||||
The payload goes inside the `data` field.
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
* Binding [API](https://github.com/dapr/docs/blob/master/reference/api/bindings_api.md)
|
||||||
|
* Binding [Components](https://github.com/dapr/docs/tree/master/concepts/bindings)
|
||||||
|
* Binding [Detailed specifications](https://github.com/dapr/docs/tree/master/reference/specs/bindings)
|
||||||
|
|
|
@ -47,3 +47,4 @@ kubectl apply -f pubsub.yaml
|
||||||
- [Setup Azure Service bus](./setup-azure-servicebus.md)
|
- [Setup Azure Service bus](./setup-azure-servicebus.md)
|
||||||
- [Setup RabbitMQ](./setup-rabbitmq.md)
|
- [Setup RabbitMQ](./setup-rabbitmq.md)
|
||||||
- [Setup GCP Pubsub](./setup-gcp.md)
|
- [Setup GCP Pubsub](./setup-gcp.md)
|
||||||
|
- [Setup Hazelcast Pubsub](./setup-hazelcast.md)
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
# Setup Hazelcast
|
||||||
|
|
||||||
|
## Locally
|
||||||
|
|
||||||
|
You can run Hazelcast locally using Docker:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -e JAVA_OPTS="-Dhazelcast.local.publicAddress=127.0.0.1:5701" -p 5701:5701 hazelcast/hazelcast
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then interact with the server using the `127.0.0.1:5701`.
|
||||||
|
|
||||||
|
## Kubernetes
|
||||||
|
|
||||||
|
The easiest way to install Hazelcast on Kubernetes is by using the [Helm chart](https://github.com/helm/charts/tree/master/stable/hazelcast):
|
||||||
|
|
||||||
|
## Create a Dapr component
|
||||||
|
|
||||||
|
The next step is to create a Dapr component for Hazelcast.
|
||||||
|
|
||||||
|
Create the following YAML file named `hazelcast.yaml`:
|
||||||
|
|
||||||
|
```
|
||||||
|
apiVersion: dapr.io/v1alpha1
|
||||||
|
kind: Component
|
||||||
|
metadata:
|
||||||
|
name: <name>
|
||||||
|
spec:
|
||||||
|
type: pubsub.hazelcast
|
||||||
|
metadata:
|
||||||
|
- name: hazelcastServers
|
||||||
|
value: <REPLACE-WITH-HOSTS> # Required. A comma delimited string of servers. Example: "hazelcast:3000,hazelcast2:3000"
|
||||||
|
```
|
||||||
|
|
||||||
|
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md).
|
||||||
|
|
||||||
|
|
||||||
|
## Apply the configuration
|
||||||
|
|
||||||
|
### In Kubernetes
|
||||||
|
|
||||||
|
To apply the Hazelcast state store to Kubernetes, use the `kubectl` CLI:
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl apply -f hazelcast.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running locally
|
||||||
|
|
||||||
|
The Dapr CLI will automatically create a directory named `components` in your current working directory with a Redis component.
|
||||||
|
To use Hazelcast, replace the redis.yaml file with the hazelcast.yaml above.
|
|
@ -84,3 +84,10 @@ res.status(500).send()
|
||||||
|
|
||||||
### Event delivery Guarantees
|
### Event delivery Guarantees
|
||||||
Event delivery guarantees are controlled by the binding implementation. Depending on the binding implementation, the event delivery can be exactly once or at least once.
|
Event delivery guarantees are controlled by the binding implementation. Depending on the binding implementation, the event delivery can be exactly once or at least once.
|
||||||
|
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
* Binding [API](https://github.com/dapr/docs/blob/master/reference/api/bindings_api.md)
|
||||||
|
* Binding [Components](https://github.com/dapr/docs/tree/master/concepts/bindings)
|
||||||
|
* Binding [Detailed specifications](https://github.com/dapr/docs/tree/master/reference/specs/bindings)
|
||||||
|
|
|
@ -35,4 +35,5 @@ ERR_MALFORMED_REQUEST | Error with a malformed request.
|
||||||
ERR_DIRECT_INVOKE | Error in direct invocation.
|
ERR_DIRECT_INVOKE | Error in direct invocation.
|
||||||
ERR_DESERIALIZE_HTTP_BODY | Error deserializing an HTTP request body.
|
ERR_DESERIALIZE_HTTP_BODY | Error deserializing an HTTP request body.
|
||||||
ERR_SECRET_STORE_NOT_CONFIGURED| Error that no secret store is configured.
|
ERR_SECRET_STORE_NOT_CONFIGURED| Error that no secret store is configured.
|
||||||
ERR_SECRET_STORE_NOT_FOUND | Error that specified secret store is not found.
|
ERR_SECRET_STORE_NOT_FOUND | Error that specified secret store is not found.
|
||||||
|
ERR_HEALTH_NOT_READY | Error that Dapr is not ready.
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Dapr health API reference
|
||||||
|
|
||||||
|
Dapr provides health checking probes that can be used as readiness or liveness of Dapr.
|
||||||
|
|
||||||
|
### Get Dapr health state
|
||||||
|
|
||||||
|
Gets the health state for Dapr.
|
||||||
|
|
||||||
|
#### HTTP Request
|
||||||
|
|
||||||
|
```http
|
||||||
|
GET http://localhost:<daprPort>/v1.0/healthz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### HTTP Response Codes
|
||||||
|
|
||||||
|
Code | Description
|
||||||
|
---- | -----------
|
||||||
|
200 | dapr is healthy
|
||||||
|
500 | dapr is not healthy
|
||||||
|
|
||||||
|
#### URL Parameters
|
||||||
|
|
||||||
|
Parameter | Description
|
||||||
|
--------- | -----------
|
||||||
|
daprPort | The Dapr port.
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl http://localhost:3500/v1.0/healthz
|
||||||
|
```
|
||||||
|
|
|
@ -20,4 +20,27 @@ spec:
|
||||||
- `storageAccessKey` is the Blob Storage access key.
|
- `storageAccessKey` is the Blob Storage access key.
|
||||||
- `container` is the name of the Blob Storage container to write to.
|
- `container` is the name of the Blob Storage container to write to.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||||
|
|
||||||
|
## Additional information
|
||||||
|
|
||||||
|
By default the Azure Blob Storage output binding will auto generate a UUID as blob filename and not assign any system or custom metadata to it. It is configurable in the Metadata property of the message (all optional).
|
||||||
|
|
||||||
|
Applications publishing to an Azure Blob Storage output binding should send a message with the following contract:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"message": "Hi"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"blobName" : "filename.txt",
|
||||||
|
"ContentType" : "text/plain",
|
||||||
|
"ContentMD5" : "vZGKbMRDAnMs4BIwlXaRvQ==",
|
||||||
|
"ContentEncoding" : "UTF-8",
|
||||||
|
"ContentLanguage" : "en-us",
|
||||||
|
"ContentDisposition" : "attachment",
|
||||||
|
"CacheControl" : "no-cache",
|
||||||
|
"Custom" : "hello-world",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
|
@ -26,4 +26,4 @@ spec:
|
||||||
- `collection` is name of the collection inside the database.
|
- `collection` is name of the collection inside the database.
|
||||||
- `partitionKey` is the name of the partitionKey to extract from the payload.
|
- `partitionKey` is the name of the partitionKey to extract from the payload.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -23,4 +23,4 @@ spec:
|
||||||
- `secretKey` is the AWS secret key.
|
- `secretKey` is the AWS secret key.
|
||||||
- `table` is the DynamoDB table name.
|
- `table` is the DynamoDB table name.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -31,4 +31,4 @@ spec:
|
||||||
- `storageContainerName` Is the name of the container in the Azure Storage account to persist checkpoints data on.
|
- `storageContainerName` Is the name of the container in the Azure Storage account to persist checkpoints data on.
|
||||||
- `partitionID` (Optional) ID of the partition to send and receive events.
|
- `partitionID` (Optional) ID of the partition to send and receive events.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||||
|
|
|
@ -44,4 +44,4 @@ spec:
|
||||||
- `client_x509_cert_url` is the GCP credentials project x509 cert url.
|
- `client_x509_cert_url` is the GCP credentials project x509 cert url.
|
||||||
- `private_key` is the GCP credentials private key.
|
- `private_key` is the GCP credentials private key.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -47,4 +47,4 @@ spec:
|
||||||
- `client_x509_cert_url` is the GCP credentials project x509 cert url.
|
- `client_x509_cert_url` is the GCP credentials project x509 cert url.
|
||||||
- `private_key` is the GCP credentials private key.
|
- `private_key` is the GCP credentials private key.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -32,4 +32,4 @@ spec:
|
||||||
- `saslUsername` is the SASL username for authentication. Only used if `authRequired` is set to - `"true"`.
|
- `saslUsername` is the SASL username for authentication. Only used if `authRequired` is set to - `"true"`.
|
||||||
- `saslPassword` is the SASL password for authentication. Only used if `authRequired` is set to - `"true"`.
|
- `saslPassword` is the SASL password for authentication. Only used if `authRequired` is set to - `"true"`.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -0,0 +1,35 @@
|
||||||
|
# AWS Kinesis Binding Spec
|
||||||
|
|
||||||
|
See [this](https://aws.amazon.com/kinesis/data-streams/getting-started/) for instructions on how to set up an AWS Kinesis data streams
|
||||||
|
|
||||||
|
```yml
|
||||||
|
apiVersion: dapr.io/v1alpha1
|
||||||
|
kind: Component
|
||||||
|
metadata:
|
||||||
|
name: <name>
|
||||||
|
spec:
|
||||||
|
type: bindings.aws.kinesis
|
||||||
|
metadata:
|
||||||
|
- name: region
|
||||||
|
value: AWS_REGION #replace
|
||||||
|
- name: accessKey
|
||||||
|
value: AWS_ACCESS_KEY # replace
|
||||||
|
- name: secretKey
|
||||||
|
value: AWS_SECRET_KEY #replace
|
||||||
|
- name: streamName
|
||||||
|
value: KINESIS_STREAM_NAME # Kinesis stream name
|
||||||
|
- name: consumerName
|
||||||
|
value: KINESIS_CONSUMER_NAME # Kinesis consumer name
|
||||||
|
- name: mode
|
||||||
|
value: shared # shared - Shared throughput or extended - Extended/Enhanced fanout
|
||||||
|
```
|
||||||
|
|
||||||
|
- `region` is the AWS region.
|
||||||
|
- `accessKey` is the AWS access key.
|
||||||
|
- `secretKey` is the AWS secret key.
|
||||||
|
- `mode` Accepted values: shared, extended. shared - Shared throughput, extended - Extended/Enhanced fanout methods. More details are [here](https://docs.aws.amazon.com/streams/latest/dev/building-consumers.html)
|
||||||
|
- `streamName` is the AWS Kinesis Stream Name.
|
||||||
|
- `consumerName` is the AWS Kinesis Consumer Name.
|
||||||
|
|
||||||
|
|
||||||
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -16,3 +16,5 @@ spec:
|
||||||
|
|
||||||
- `url` is the MQTT broker url.
|
- `url` is the MQTT broker url.
|
||||||
- `topic` is the topic to listen on or send events to.
|
- `topic` is the topic to listen on or send events to.
|
||||||
|
|
||||||
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -11,7 +11,7 @@ spec:
|
||||||
- name: queueName
|
- name: queueName
|
||||||
value: queue1
|
value: queue1
|
||||||
- name: host
|
- name: host
|
||||||
value: amqp://guest:guest@localhost:5672
|
value: amqp://[username][:password]@host.domain[:port]
|
||||||
- name: durable
|
- name: durable
|
||||||
value: true
|
value: true
|
||||||
- name: deleteWhenUnused
|
- name: deleteWhenUnused
|
||||||
|
@ -21,4 +21,6 @@ spec:
|
||||||
- `queueName` is the RabbitMQ queue name.
|
- `queueName` is the RabbitMQ queue name.
|
||||||
- `host` is the RabbitMQ host address.
|
- `host` is the RabbitMQ host address.
|
||||||
- `durable` tells RabbitMQ to persist message in storage.
|
- `durable` tells RabbitMQ to persist message in storage.
|
||||||
- `deleteWhenUnused` enables or disables auto-delete.
|
- `deleteWhenUnused` enables or disables auto-delete.
|
||||||
|
|
||||||
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -17,4 +17,4 @@ spec:
|
||||||
- `redisHost` is the Redis host address.
|
- `redisHost` is the Redis host address.
|
||||||
- `redisPassword` is the Redis password.
|
- `redisPassword` is the Redis password.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||||
|
|
|
@ -23,4 +23,4 @@ spec:
|
||||||
- `secretKey` is the AWS secret key.
|
- `secretKey` is the AWS secret key.
|
||||||
- `table` is the name of the S3 bucket to write to.
|
- `table` is the name of the S3 bucket to write to.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -17,4 +17,4 @@ spec:
|
||||||
- `connectionString` is the Service Bus connection string.
|
- `connectionString` is the Service Bus connection string.
|
||||||
- `queueName` is the Service Bus queue name.
|
- `queueName` is the Service Bus queue name.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -17,7 +17,7 @@ spec:
|
||||||
- The metadata `connectionString` contains the Azure SignalR connection string.
|
- The metadata `connectionString` contains the Azure SignalR connection string.
|
||||||
- The optional `hub` metadata value defines the hub in which the message will be send. The hub can be dynamically defined as a metadata value when publishing to an output binding (key is "hub").
|
- The optional `hub` metadata value defines the hub in which the message will be send. The hub can be dynamically defined as a metadata value when publishing to an output binding (key is "hub").
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||||
|
|
||||||
## Additional information
|
## Additional information
|
||||||
|
|
||||||
|
|
|
@ -23,4 +23,4 @@ spec:
|
||||||
- `secretKey` is the AWS secret key.
|
- `secretKey` is the AWS secret key.
|
||||||
- `topicArn` is the SNS topic name.
|
- `topicArn` is the SNS topic name.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -23,4 +23,4 @@ spec:
|
||||||
- `secretKey` is the AWS secret key.
|
- `secretKey` is the AWS secret key.
|
||||||
- `queueName` is the SQS queue name.
|
- `queueName` is the SQS queue name.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -16,6 +16,8 @@ spec:
|
||||||
value: "myqueue"
|
value: "myqueue"
|
||||||
```
|
```
|
||||||
|
|
||||||
`storageAccount` is the Azure Storage account name.
|
- `storageAccount` is the Azure Storage account name.
|
||||||
`storageAccessKey` is the Azure Storage access key.
|
- `storageAccessKey` is the Azure Storage access key.
|
||||||
`queue` is the name of the Azure Storage queue.
|
- `queue` is the name of the Azure Storage queue.
|
||||||
|
|
||||||
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
|
@ -23,4 +23,4 @@ spec:
|
||||||
- `accountSid` is the Twilio account SID.
|
- `accountSid` is the Twilio account SID.
|
||||||
- `authToken` is the Twilio auth token.
|
- `authToken` is the Twilio auth token.
|
||||||
|
|
||||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securly storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
Loading…
Reference in New Issue