|
|
@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.Azure.ServiceBus; |
|
|
|
using Azure.Messaging.ServiceBus; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; |
|
|
|
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; |
|
|
@ -281,10 +281,9 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API |
|
|
|
services.AddSingleton<IServiceBusPersisterConnection>(sp => |
|
|
|
{ |
|
|
|
var settings = sp.GetRequiredService<IOptions<CatalogSettings>>().Value; |
|
|
|
var serviceBusConnection = new ServiceBusConnectionStringBuilder(settings.EventBusConnection); |
|
|
|
var subscriptionClientName = configuration["SubscriptionClientName"]; |
|
|
|
var serviceBusConnection = settings.EventBusConnection; |
|
|
|
|
|
|
|
return new DefaultServiceBusPersisterConnection(serviceBusConnection, subscriptionClientName); |
|
|
|
return new DefaultServiceBusPersisterConnection(serviceBusConnection); |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
@ -333,9 +332,11 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API |
|
|
|
var iLifetimeScope = sp.GetRequiredService<ILifetimeScope>(); |
|
|
|
var logger = sp.GetRequiredService<ILogger<EventBusServiceBus>>(); |
|
|
|
var eventBusSubcriptionsManager = sp.GetRequiredService<IEventBusSubscriptionsManager>(); |
|
|
|
string topicName = "topicName"; |
|
|
|
string subscriptionName = "subscriptionName"; |
|
|
|
|
|
|
|
return new EventBusServiceBus(serviceBusPersisterConnection, logger, |
|
|
|
eventBusSubcriptionsManager, iLifetimeScope); |
|
|
|
eventBusSubcriptionsManager, iLifetimeScope, topicName, subscriptionName); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|