resolve errors
This commit is contained in:
parent
9db2a46502
commit
cf4b786454
@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Azure.Messaging.ServiceBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
|
||||
|
@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Azure.Messaging.ServiceBus;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Autofac;
|
||||
using Microsoft.Azure.ServiceBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
|
||||
@ -54,9 +53,8 @@ namespace Ordering.BackgroundTasks.Extensions
|
||||
services.AddSingleton<IServiceBusPersisterConnection>(sp =>
|
||||
{
|
||||
var serviceBusConnectionString = configuration["EventBusConnection"];
|
||||
var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString);
|
||||
|
||||
return new DefaultServiceBusPersisterConnection(serviceBusConnection, subscriptionClientName);
|
||||
return new DefaultServiceBusPersisterConnection(serviceBusConnectionString);
|
||||
});
|
||||
|
||||
services.AddSingleton<IEventBus, EventBusServiceBus>(sp =>
|
||||
@ -65,8 +63,10 @@ namespace Ordering.BackgroundTasks.Extensions
|
||||
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);
|
||||
return new EventBusServiceBus(serviceBusPersisterConnection, logger, eventBusSubcriptionsManager, iLifetimeScope, topicName, subscriptionName);
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -4,7 +4,6 @@ using HealthChecks.UI.Client;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.Azure.ServiceBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
|
||||
@ -65,11 +64,10 @@ namespace Ordering.SignalrHub
|
||||
services.AddSingleton<IServiceBusPersisterConnection>(sp =>
|
||||
{
|
||||
var serviceBusConnectionString = Configuration["EventBusConnection"];
|
||||
var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString);
|
||||
|
||||
var subscriptionClientName = Configuration["SubscriptionClientName"];
|
||||
|
||||
return new DefaultServiceBusPersisterConnection(serviceBusConnection, subscriptionClientName);
|
||||
return new DefaultServiceBusPersisterConnection(serviceBusConnectionString);
|
||||
});
|
||||
}
|
||||
else
|
||||
@ -213,9 +211,11 @@ namespace Ordering.SignalrHub
|
||||
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);
|
||||
});
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user