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

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Publishing the integration event to Azure Service Bus

Publishing the integration event to Azure Service Bus - Azure Tutorial

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

Publishing the integration event to Azure Service Bus

- We've already handled the domain event and created an integration event object. Now we're going to send that integration event to Azure Service Bus. The first thing that we need to do is to add a new new get package reference here in the pet API project. So let's select manage new get packages, and the package is Azure Messaging Service Bus. This includes the API for communicating to Azure Service Bus. Okay, let's install it. Excellent. Now we're ready to implement some code in the paid application service class. I'm going to create a new private method named publish integration event async that is going to receive an I integration event object. Also, we're going to receive the connection string and the topic name. So here, I'm going to serialize the integration event object by using new (indistinct) of Jason. So let's use this Jason convert class, and I'm going to use serialize object passing this integration…

Contents