Binding specs

This commit is contained in:
Aaron Crawfis 2020-10-15 14:42:49 -07:00
parent 3e5858fa39
commit e7f2ab2250
29 changed files with 231 additions and 93 deletions

View File

@ -6,84 +6,34 @@ weight: 100
description: Overview of the Dapr bindings building block
---
Using bindings, you can trigger your app with events coming in from external systems, or invoke external systems. This building block provides several benefits for you and your code:
## Introduction
* Remove the complexities of connecting to, and polling from, messaging systems such as queues and message buses
* Focus on business logic and not implementation details of how to interact with a system
* Keep your code free from SDKs or libraries
* Handle retries and failure recovery
* Switch between bindings at run time
* Build portable applications where environment-specific bindings are set-up and no code changes are required
Using bindings, you can trigger your app with events coming in from external systems, or interface with external systems. This building block provides several benefits for you and your code:
- Remove the complexities of connecting to, and polling from, messaging systems such as queues and message buses
- Focus on business logic and not implementation details of how to interact with a system
- Keep your code free from SDKs or libraries
- Handle retries and failure recovery
- Switch between bindings at run time
- Build portable applications where environment-specific bindings are set-up and no code changes are required
For a specific example, bindings would allow your microservice to respond to incoming Twilio/SMS messages without adding or configuring a third-party Twilio SDK, worrying about polling from Twilio (or using websockets, etc.).
Bindings are developed independently of Dapr runtime. You can view and contribute to the bindings [here](https://github.com/dapr/components-contrib/tree/master/bindings).
## Supported bindings and specs
Every binding has its own unique set of properties. Click the name link to see the component YAML for each binding.
### Generic
| Name | Input<br>Binding | Output<br>Binding | Status |
|------|:----------------:|:-----------------:|--------|
| [Cron (Scheduler)](../../reference/specs/bindings/cron.md) | ✅ | ✅ | Experimental |
| [HTTP](../../reference/specs/bindings/http.md) | | ✅ | Experimental |
| [InfluxDB](../../reference/specs/bindings/influxdb.md) | | ✅ | Experimental |
| [Kafka](../../reference/specs/bindings/kafka.md) | ✅ | ✅ | Experimental |
| [Kubernetes Events](../../reference/specs/bindings/kubernetes.md) | ✅ | | Experimental |
| [MQTT](../../reference/specs/bindings/mqtt.md) | ✅ | ✅ | Experimental |
| [PostgreSql](../../reference/specs/bindings/postgres.md) | | ✅ | Experimental |
| [RabbitMQ](../../reference/specs/bindings/rabbitmq.md) | ✅ | ✅ | Experimental |
| [Redis](../../reference/specs/bindings/redis.md) | | ✅ | Experimental |
| [Twilio](../../reference/specs/bindings/twilio.md) | | ✅ | Experimental |
| [Twitter](../../reference/specs/bindings/twitter.md) | ✅ | ✅ | Experimental |
| [SendGrid](../../reference/specs/bindings/sendgrid.md) | | ✅ | Experimental |
### Amazon Web Service (AWS)
| Name | Input<br>Binding | Output<br>Binding | Status |
|------|:----------------:|:-----------------:|--------|
| [AWS DynamoDB](../../reference/specs/bindings/dynamodb.md) | | ✅ | Experimental |
| [AWS S3](../../reference/specs/bindings/s3.md) | | ✅ | Experimental |
| [AWS SNS](../../reference/specs/bindings/sns.md) | | ✅ | Experimental |
| [AWS SQS](../../reference/specs/bindings/sqs.md) | ✅ | ✅ | Experimental |
| [AWS Kinesis](../../reference/specs/bindings/kinesis.md) | ✅ | ✅ | Experimental |
### Google Cloud Platform (GCP)
| Name | Input<br>Binding | Output<br>Binding | Status |
|------|:----------------:|:-----------------:|--------|
| [GCP Cloud Pub/Sub](../../reference/specs/bindings/gcppubsub.md) | ✅ | ✅ | Experimental |
| [GCP Storage Bucket](../../reference/specs/bindings/gcpbucket.md) | | ✅ | Experimental |
### Microsoft Azure
| Name | Input<br>Binding | Output<br>Binding | Status |
|------|:----------------:|:-----------------:|--------|
| [Azure Blob Storage](../../reference/specs/bindings/blobstorage.md) | | ✅ | Experimental |
| [Azure EventHubs](../../reference/specs/bindings/eventhubs.md) | ✅ | ✅ | Experimental |
| [Azure CosmosDB](../../reference/specs/bindings/cosmosdb.md) | | ✅ | Experimental |
| [Azure Service Bus Queues](../../reference/specs/bindings/servicebusqueues.md) | ✅ | ✅ | Experimental |
| [Azure SignalR](../../reference/specs/bindings/signalr.md) | | ✅ | Experimental |
| [Azure Storage Queues](../../reference/specs/bindings/storagequeues.md) | ✅ | ✅ | Experimental |
| [Azure Event Grid](../../reference/specs/bindings/eventgrid.md) | ✅ | ✅ | Experimental |
## Input bindings
Input bindings are used to trigger your application when an event from an external resource has occurred.
An optional payload and metadata might be sent with the request.
An optional payload and metadata may be sent with the request.
In order to receive events from an input binding:
1. Define the component YAML that describes the type of binding and its metadata (connection info, etc.)
2. Listen on an HTTP endpoint for the incoming event, or use the gRPC proto library to get incoming events
> On startup Dapr sends a ```OPTIONS``` request for all defined input bindings to the application and expects a different status code as ```NOT FOUND (404)``` if this application wants to subscribe to the binding.
> On startup Dapr sends a `OPTIONS` request for all defined input bindings to the application and expects a status code other than `NOT FOUND (404)` if this application wants to subscribe to the binding.
Read the [Create an event-driven app using input bindings](../../howto/trigger-app-with-input-binding) section to get started with input bindings.
Read the [Create an event-driven app using input bindings]({{< ref howto-triggers.md >}}) page to get started with input bindings.
## Output bindings
@ -95,10 +45,62 @@ In order to invoke an output binding:
1. Define the component YAML that describes the type of binding and its metadata (connection info, etc.)
2. Use the HTTP endpoint or gRPC method to invoke the binding with an optional payload
Read the [Send events to external systems using Output Bindings](../../howto/send-events-with-output-bindings) section to get started with output bindings.
Read the [Send events to external systems using Output Bindings]({{< ref howto-bindings.md >}}) page to get started with output bindings.
## Supported bindings
Every binding has its own unique set of properties. Click the name link to see the component YAML for each binding.
### Generic
| Name | Input<br>Binding | Output<br>Binding | Status |
|------|:----------------:|:-----------------:|--------|
| [Cron (Scheduler)]({{< ref cron.md >}}) | ✅ | ✅ | Experimental |
| [HTTP]({{< ref http.md >}}) | | ✅ | Experimental |
| [InfluxDB]({{< ref influxdb.md >}}) | | ✅ | Experimental |
| [Kafka]({{< ref kafka.md >}}) | ✅ | ✅ | Experimental |
| [Kubernetes Events]({{< ref "kubernetes-binding.md" >}}) | ✅ | | Experimental |
| [MQTT]({{< ref mqtt.md >}}) | ✅ | ✅ | Experimental |
| [PostgreSql]({{< ref postgres.md >}}) | | ✅ | Experimental |
| [RabbitMQ]({{< ref rabbitmq.md >}}) | ✅ | ✅ | Experimental |
| [Redis]({{< ref redis.md >}}) | | ✅ | Experimental |
| [Twilio]({{< ref twilio.md >}}) | | ✅ | Experimental |
| [Twitter]({{< ref twitter.md >}}) | ✅ | ✅ | Experimental |
| [SendGrid]({{< ref sendgrid.md >}}) | | ✅ | Experimental |
### Amazon Web Service (AWS)
| Name | Input<br>Binding | Output<br>Binding | Status |
|------|:----------------:|:-----------------:|--------|
| [AWS DynamoDB]({{< ref dynamodb.md >}}) | | ✅ | Experimental |
| [AWS S3]({{< ref s3.md >}}) | | ✅ | Experimental |
| [AWS SNS]({{< ref sns.md >}}) | | ✅ | Experimental |
| [AWS SQS]({{< ref sqs.md >}}) | ✅ | ✅ | Experimental |
| [AWS Kinesis]({{< ref kinesis.md >}}) | ✅ | ✅ | Experimental |
### Google Cloud Platform (GCP)
| Name | Input<br>Binding | Output<br>Binding | Status |
|------|:----------------:|:-----------------:|--------|
| [GCP Cloud Pub/Sub]({{< ref gcppubsub.md >}}) | ✅ | ✅ | Experimental |
| [GCP Storage Bucket]({{< ref gcpbucket.md >}}) | | ✅ | Experimental |
### Microsoft Azure
| Name | Input<br>Binding | Output<br>Binding | Status |
|------|:----------------:|:-----------------:|--------|
| [Azure Blob Storage]({{< ref blobstorage.md >}}) | | ✅ | Experimental |
| [Azure EventHubs]({{< ref eventhubs.md >}}) | ✅ | ✅ | Experimental |
| [Azure CosmosDB]({{< ref cosmosdb.md >}}) | | ✅ | Experimental |
| [Azure Service Bus Queues]({{< ref servicebusqueues.md >}}) | ✅ | ✅ | Experimental |
| [Azure SignalR]({{< ref signalr.md >}}) | | ✅ | Experimental |
| [Azure Storage Queues]({{< ref storagequeues.md >}}) | ✅ | ✅ | Experimental |
| [Azure Event Grid]({{< ref eventgrid.md >}}) | ✅ | ✅ | Experimental |
## Related Topics
* [Implementing a new binding](https://github.com/dapr/docs/tree/master/reference/specs/bindings)
* [Trigger a service from different resources with input bindings](../../howto/trigger-app-with-input-binding)
* [Invoke different resources using output bindings](../../howto/send-events-with-output-bindings)
- [Implementing a new binding]({{< ref binding-specs >}})
- [Trigger a service from different resources with input bindings]({{< ref howto-triggers.md >}})
- [Invoke different resources using output bindings]({{< ref howto-bindings.md >}})

View File

@ -1,4 +1,10 @@
# Binding component specs
---
type: docs
title: "Binding component specs"
linkTitle: "Bindings"
weight: 300
description: "Detailed documentation on the various binding component specs"
---
The files within this directory contain the detailed information for each binding component, including the applicable fields, structure, and explanation.

View File

@ -1,4 +1,9 @@
# Azure Blob Storage Binding Spec
---
type: docs
title: "Azure Blob Storage binding spec"
linkTitle: "Azure Blob Storage"
description: "Detailed documentation on the Azure Blob Storage binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Azure CosmosDB Binding Spec
---
type: docs
title: "Azure CosmosDB binding spec"
linkTitle: "Azure CosmosDB"
description: "Detailed documentation on the Azure CosmosDB binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Cron Binding Spec
---
type: docs
title: "Cron binding spec"
linkTitle: "Cron"
description: "Detailed documentation on the cron binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# AWS DynamoDB Binding Spec
---
type: docs
title: "AWS DynamoDB binding spec"
linkTitle: "AWS DynamoDB"
description: "Detailed documentation on the AWS DynamoDB binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Azure Event Grid Binding Spec
---
type: docs
title: "Azure Event Grid binding spec"
linkTitle: "Azure Event Grid"
description: "Detailed documentation on the Azure Event Grid binding component"
---
See [this](https://docs.microsoft.com/en-us/azure/event-grid/) for Azure Event Grid documentation.

View File

@ -1,4 +1,9 @@
# Azure Event Hubs Binding Spec
---
type: docs
title: "Azure Event Hubs binding spec"
linkTitle: "Azure Event Hubs"
description: "Detailed documentation on the Azure Event Hubs binding component"
---
See [this](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-framework-getstarted-send) for instructions on how to set up an Event Hub.

View File

@ -1,4 +1,9 @@
# GCP Storage Bucket Spec
---
type: docs
title: "GCP Storage Bucket binding spec"
linkTitle: "GCP Storage Bucket"
description: "Detailed documentation on the GCP Storage Bucket binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# GCP Cloud Pub/Sub Binding Spec
---
type: docs
title: "GCP Pub/Sub binding spec"
linkTitle: "GCP Pub/Sub"
description: "Detailed documentation on the GCP Pub/Sub binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# HTTP Binding Spec
---
type: docs
title: "HTTP binding spec"
linkTitle: "HTTP"
description: "Detailed documentation on the HTTP binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# InfluxDB Binding Spec
---
type: docs
title: "InfluxDB binding spec"
linkTitle: "InfluxDB"
description: "Detailed documentation on the InfluxDB binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Kafka Binding Spec
---
type: docs
title: "Cron binding spec"
linkTitle: "Cron"
description: "Detailed documentation on the cron binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# AWS Kinesis Binding Spec
---
type: docs
title: "AWS Kinesis binding spec"
linkTitle: "AWS Kinesis"
description: "Detailed documentation on the AWS Kinesis binding component"
---
See [this](https://aws.amazon.com/kinesis/data-streams/getting-started/) for instructions on how to set up an AWS Kinesis data streams

View File

@ -1,4 +1,9 @@
# Kubernetes Events Binding Spec
---
type: docs
title: "Kubernetes Events binding spec"
linkTitle: "Kubernetes Events"
description: "Detailed documentation on the Kubernetes Events binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# MQTT Binding Spec
---
type: docs
title: "MQTT binding spec"
linkTitle: "MQTT"
description: "Detailed documentation on the MQTT binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# PostgrSQL Binding Spec
---
type: docs
title: "PostgrSQL binding spec"
linkTitle: "PostgrSQL"
description: "Detailed documentation on the PostgrSQL binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# RabbitMQ Binding Spec
---
type: docs
title: "RabbitMQ binding spec"
linkTitle: "RabbitMQ"
description: "Detailed documentation on the RabbitMQ binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Redis Binding Spec
---
type: docs
title: "Redis binding spec"
linkTitle: "Redis"
description: "Detailed documentation on the Redis binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# AWS S3 Binding Spec
---
type: docs
title: "AWS S3 binding spec"
linkTitle: "AWS S3"
description: "Detailed documentation on the AWS S3 binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# SendGrid Binding Spec
---
type: docs
title: "Twilio SendGrid binding spec"
linkTitle: "Twilio SendGrid"
description: "Detailed documentation on the Twilio SendGrid binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Azure Service Bus Queues Binding Spec
---
type: docs
title: "Azure Service Bus Queues binding spec"
linkTitle: "Azure Service Bus Queues"
description: "Detailed documentation on the Azure Service Bus Queues binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Azure SignalR Binding Spec
---
type: docs
title: "Azure SignalR binding spec"
linkTitle: "Azure SignalR"
description: "Detailed documentation on the Azure SignalR binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# AWS SNS Binding Spec
---
type: docs
title: "AWS SNS binding spec"
linkTitle: "AWS SNS"
description: "Detailed documentation on the AWS SNS binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# AWS SQS Binding Spec
---
type: docs
title: "AWS SQS binding spec"
linkTitle: "AWS SQS"
description: "Detailed documentation on the AWS SQS binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Azure Storage Queues Binding Spec
---
type: docs
title: "Azure Storage Queues binding spec"
linkTitle: "Azure Storage Queues"
description: "Detailed documentation on the Azure Storage Queues binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Twilio SMS Binding Spec
---
type: docs
title: "Twilio SMS binding spec"
linkTitle: "Twilio SMS"
description: "Detailed documentation on the Twilio SMS binding component"
---
```yaml
apiVersion: dapr.io/v1alpha1

View File

@ -1,4 +1,9 @@
# Twitter Binding Spec
---
type: docs
title: "Twitter binding spec"
linkTitle: "Twitter"
description: "Detailed documentation on the Twitter binding component"
---
The Twitter binding supports both `input` and `output` binding configuration. First the common part: