Bindings overview
Using Dapr’s bindings API, you can trigger your app with events coming in from external systems and interface with external systems. With the bindings API, you can:
- Focus on business logic, instead of the implementation details of interacting with a system.
- Keep your code free from SDKs or libraries.
- Handle retries and failure recovery.
- Switch between bindings at runtime.
- Build portable applications with environment-specific bindings set-up and no required code changes.
For example, with bindings, your microservice can respond to incoming Twilio/SMS messages without:
- Adding or configuring a third-party Twilio SDK
- Worrying about polling from Twilio (or using WebSockets, etc.)
Note
Bindings are developed independently of Dapr runtime. You can view and contribute to the bindings.
To receive events from an input binding:
- Define the component YAML that describes the binding type and its metadata (connection info, etc.).
Note
On startup, Dapr sends for all defined input bindings to the application. If the application wants to subscribe to the binding, Dapr expects a status code of 2xx or 405.
Read the Create an event-driven app using input bindings guide to get started with input bindings.
To invoke an output binding:
- Define the component YAML that describes the binding type and its metadata (connection info, etc.).
- Use the HTTP endpoint or gRPC method to invoke the binding with an optional payload.
Read the Use output bindings to interface with external resources guide to get started with output bindings.
Want to put the Dapr bindings API to the test? Walk through the following quickstart and tutorials to see bindings in action:
Start using bindings directly in your app
- Follow these guides on:
- Try out the to experiment with binding to a Kafka queue.