Ingesting data with the Azure Event Hubs input binding
In a previous section of this chapter, we learned how to implement a simple input binding thanks to the cron
sample. In this section, we will explore another input binding, leveraging the Azure Event Hubs cloud messaging service, by implementing it in the context of reservation-service
.
The responsibility of reservation-service
is to allocate quantities of a certain product (cookies) as a new order comes in. In this context, we never considered that if there is a process to reserve (and therefore subtract) quantities, then there should be an equivalent—but opposite—process to increment the available quantity. This is our chance to fix the business logic of our sample.
In the context of our sample’s cookie-selling e-commerce site, let’s suppose there is an external service overseeing the manufacturing process, which produces cookies to be sold and/or customized according to customers’ requests...