From the course: Azure Microservices with .NET Core for Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Synchronous communication to the customers microservice

Solution: Synchronous communication to the customers microservice - Azure Tutorial

From the course: Azure Microservices with .NET Core for Developers

Start my 1-month free trial

Solution: Synchronous communication to the customers microservice

(upbeat music) - [Narrator] Let me show you how I managed to implement the communication to the customers' microservice. I added these ICustomersService interface. Here, I'm returning a dynamic object rather than a concrete model object. This is because I'm using the entire customer information that I'm receiving from the customers microservice. But you could add a specific model class and deserialize the data to that type if you need to. Next I implemented this interface inside this customer service pass, where I'm injecting these IHttpClientFactory reference. And also I'm injecting these ILogger of type customer service logger object. Here in the get customer async methods I'm invoking the microservice by using these api/customers/customer id endpoint. And I'm receiving the response then I'm deserealizing the data by using this JsonSerializer class. I also modified this startup class. So, I'm adding these customer…

Contents