|
@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Builder; |
|
|
using Microsoft.AspNetCore.Diagnostics.HealthChecks; |
|
|
using Microsoft.AspNetCore.Diagnostics.HealthChecks; |
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
using Microsoft.Azure.ServiceBus; |
|
|
|
|
|
|
|
|
using Azure.Messaging.ServiceBus; |
|
|
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; |
|
|
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; |
|
|
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; |
|
|
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; |
|
|
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; |
|
|
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; |
|
@ -122,10 +122,9 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API |
|
|
services.AddSingleton<IServiceBusPersisterConnection>(sp => |
|
|
services.AddSingleton<IServiceBusPersisterConnection>(sp => |
|
|
{ |
|
|
{ |
|
|
var serviceBusConnectionString = Configuration["EventBusConnection"]; |
|
|
var serviceBusConnectionString = Configuration["EventBusConnection"]; |
|
|
var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString); |
|
|
|
|
|
|
|
|
|
|
|
var subscriptionClientName = Configuration["SubscriptionClientName"]; |
|
|
var subscriptionClientName = Configuration["SubscriptionClientName"]; |
|
|
return new DefaultServiceBusPersisterConnection(serviceBusConnection, subscriptionClientName); |
|
|
|
|
|
|
|
|
return new DefaultServiceBusPersisterConnection(serviceBusConnectionString); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
@ -285,9 +284,11 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API |
|
|
var iLifetimeScope = sp.GetRequiredService<ILifetimeScope>(); |
|
|
var iLifetimeScope = sp.GetRequiredService<ILifetimeScope>(); |
|
|
var logger = sp.GetRequiredService<ILogger<EventBusServiceBus>>(); |
|
|
var logger = sp.GetRequiredService<ILogger<EventBusServiceBus>>(); |
|
|
var eventBusSubcriptionsManager = sp.GetRequiredService<IEventBusSubscriptionsManager>(); |
|
|
var eventBusSubcriptionsManager = sp.GetRequiredService<IEventBusSubscriptionsManager>(); |
|
|
|
|
|
string topicName = "topicName"; |
|
|
|
|
|
string subscriptionName = "subscriptionName"; |
|
|
|
|
|
|
|
|
return new EventBusServiceBus(serviceBusPersisterConnection, logger, |
|
|
return new EventBusServiceBus(serviceBusPersisterConnection, logger, |
|
|
eventBusSubcriptionsManager, iLifetimeScope); |
|
|
|
|
|
|
|
|
eventBusSubcriptionsManager, iLifetimeScope, topicName, subscriptionName); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|