Eliemerson Fonseca
Eliemerson Fonseca

Reputation: 757

How configure EventBusServiceBus with Azure Service Bus?

I need to configure a Library EventBusServiceBus, but searching did not found any sample. Please, I need examples, how to configure a connection with EventBusServiceBus using appSettings.json

Upvotes: 0

Views: 1191

Answers (2)

MithunChopda
MithunChopda

Reputation: 45

When using the eShopOnContainers application, Service Bus is not properly implemented in the GIT repo.

You are missing entityPath parameter in your connection string. You will have to first create a Topic in Azure Service Bus. Set the entityPath= name of your topic in Azure Service Bus. In Azure Service Bus, also create a Subscription for this Topic. You will need to configure this in the appsettings.json file. Set the value of the subscriptionClientName in appsettings file to the name of the Subscription you just created.

Upvotes: 0

Sean Feldman
Sean Feldman

Reputation: 25994

This is a ".NET Microservices: Architecture for Containerized .NET Applications" e-book, aka eShopOnContainers with code on GitHub.

EventBusServiceBus should receive an implementation of IServiceBusPersisterConnection. Which is implemented with DefaultServiceBusPersisterConnection, which subsequently depends on Azure Service Bus ServiceBusConnectionStringBuilder to be created and registered in the services. An example would be one of the services configurations such as Ordering service here.

In appsettings.json you'll have to define the following settings:

  • AzureServiceBusEnabled set to true
  • EventBusConnection set to the Azure Service Bus connection string

Upvotes: 1

Related Questions