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:
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.
Input bindings are used to trigger your application when an event from an external resource has occurred. An optional payload and metadata may be sent with the request.
In order to receive events from an input binding:
On startup Dapr sends a
OPTIONS
request for all defined input bindings to the application and expects a status code other thanNOT FOUND (404)
if this application wants to subscribe to the binding.
Read the Create an event-driven app using input bindings page to get started with input bindings.
Output bindings allow you to invoke external resources. An optional payload and metadata can be sent with the invocation request.
In order to invoke an output binding:
Read the Use output bindings to interface with external resources page to get started with output bindings.