Using Twilio output bindings in Dapr
An output binding enables our microservice to actively interact with an external system or service without having to deal with software development kits (SDKs), libraries, or application programming interfaces (APIs) other than the Dapr API. In our C# sample, we will use the Dapr .NET SDK to abstract this interaction.
In the previous chapter, Chapter 6, Publish and Subscribe, we introduced the shipping-service
project: this Dapr application subscribes to the OnOrder_Prepared
topic to be informed once all the steps in the order-preparation saga reach a positive conclusion.
We intend to increase the functionality of this microservice by informing the customer that the order is shipped. To do so, we can leverage a notification service such as Twilio to send the customer a Short Message Service (SMS) message, as follows:
Figure 7.1 – Twilio output binding added to the shipping service
In Figure 7.1, you can see...