diff --git a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs index 368629681..3b58f2e49 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs @@ -7,18 +7,20 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions { void Publish(IntegrationEvent @event); - void Subscribe(String vHost) + void Subscribe() where T : IntegrationEvent where TH : IIntegrationEventHandler; - void SubscribeDynamic(string eventName, String vHost) + void SubscribeDynamic(string eventName) where TH : IDynamicIntegrationEventHandler; - void UnsubscribeDynamic(string eventName, String vHost) + void UnsubscribeDynamic(string eventName) where TH : IDynamicIntegrationEventHandler; - void Unsubscribe(String vHost) + void Unsubscribe() where TH : IIntegrationEventHandler where T : IntegrationEvent; + + String GetVHost(); } } diff --git a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs index dee3add48..e13881fbe 100644 --- a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs +++ b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs @@ -177,4 +177,25 @@ class CompositeHandler { public String TenantVHostName { get; set; } public String EventName { get; set; } + + protected bool Equals(CompositeHandler other) + { + return TenantVHostName == other.TenantVHostName && EventName == other.EventName; + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((CompositeHandler) obj); + } + + public override int GetHashCode() + { + unchecked + { + return ((TenantVHostName != null ? TenantVHostName.GetHashCode() : 0) * 397) ^ (EventName != null ? EventName.GetHashCode() : 0); + } + } } \ No newline at end of file diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs index c9d148aaf..84d39c979 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs @@ -33,14 +33,15 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ private static readonly String tenantACustomisationUrl = @"http://tenantacustomisation/"; private static readonly String tenantManagerUrl = @"http://tenantmanager/"; private readonly int _retryCount; - private readonly Dictionary _tenantInfo; + private readonly Dictionary _tenantInfo; + public String vHost { get; set; } private IModel _consumerChannel; private string _queueName; public EventBusRabbitMQ(IRabbitMQPersistentConnection persistentConnection, ILogger logger, - ILifetimeScope autofac, IEventBusSubscriptionsManager subsManager, string queueName = null, + ILifetimeScope autofac, IEventBusSubscriptionsManager subsManager, String vhost, string queueName = null, int retryCount = 5) { _persistentConnection = @@ -55,6 +56,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ _tenantInfo = new Dictionary(); _tenantInfo.Add(1, "TenantA"); _tenantInfo.Add(2, "TenantB"); + vHost = vhost; } private void SubsManager_OnEventRemoved(object sender, string eventName) @@ -126,23 +128,23 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ } } - public void SubscribeDynamic(string eventName, String vHost) + public void SubscribeDynamic(string eventName) where TH : IDynamicIntegrationEventHandler { _logger.LogInformation("Subscribing to dynamic event {EventName} with {EventHandler}", eventName, typeof(TH).GetGenericTypeName()); - DoInternalSubscription(eventName, vHost); + DoInternalSubscription(eventName); _subsManager.AddDynamicSubscription(eventName, vHost); StartBasicConsume(); } - public void Subscribe(String vHost) + public void Subscribe() where T : IntegrationEvent where TH : IIntegrationEventHandler { var eventName = _subsManager.GetEventKey(); - DoInternalSubscription(eventName, vHost); + DoInternalSubscription(eventName); _logger.LogInformation("Subscribing to event {EventName} with {EventHandler}", eventName, typeof(TH).GetGenericTypeName()); @@ -151,7 +153,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ StartBasicConsume(); } - private void DoInternalSubscription(string eventName, String vHost) + private void DoInternalSubscription(string eventName) { var containsKey = _subsManager.HasSubscriptionsForEvent(eventName, vHost); if (!containsKey) @@ -170,7 +172,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ } } - public void Unsubscribe(String vHost) + public void Unsubscribe() where T : IntegrationEvent where TH : IIntegrationEventHandler { @@ -181,7 +183,12 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ _subsManager.RemoveSubscription(vHost); } - public void UnsubscribeDynamic(string eventName, String vHost) + public string GetVHost() + { + return vHost; + } + + public void UnsubscribeDynamic(string eventName) where TH : IDynamicIntegrationEventHandler { _subsManager.RemoveDynamicSubscription(eventName, vHost); @@ -337,11 +344,11 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ { _logger.LogWarning("Processing RabbitMQ event: {EventName}", eventName); - if (_subsManager.HasSubscriptionsForEvent(eventName)) + if (_subsManager.HasSubscriptionsForEvent(eventName, vHost)) { using (var scope = _autofac.BeginLifetimeScope(AUTOFAC_SCOPE_NAME)) { - var subscriptions = _subsManager.GetHandlersForEvent(eventName); + var subscriptions = _subsManager.GetHandlersForEvent(eventName, vHost); foreach (var subscription in subscriptions) { if (subscription.IsDynamic) diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/MultiEventBusRabbitMQ.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/MultiEventBusRabbitMQ.cs index 17e161c09..9a92a1eb7 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/MultiEventBusRabbitMQ.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/MultiEventBusRabbitMQ.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; @@ -6,7 +7,6 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ { public class MultiEventBusRabbitMQ : IMultiEventBus { - private List _eventBuses; public MultiEventBusRabbitMQ(List eventBuses) @@ -21,16 +21,20 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ public void Publish(IntegrationEvent @event) { + //TODO + var actualEventBus = _eventBuses.Find(e => e.GetVHost().Equals("TenantA")); + + if (actualEventBus == null) + { + throw new Exception(); + } - throw new System.NotImplementedException(); + actualEventBus.Publish(@event); } public void Subscribe() where T : IntegrationEvent where TH : IIntegrationEventHandler { - _eventBuses.ForEach(e => - { - e.Subscribe(); - }); + _eventBuses.ForEach(e => { e.Subscribe(); }); } } } \ No newline at end of file diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs index 53ae33ae0..f88361688 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs @@ -1,4 +1,4 @@ -namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus +/*namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus { using Autofac; using Microsoft.Azure.ServiceBus; @@ -206,3 +206,4 @@ } } } +*/ \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/Controllers/BasketController.cs b/src/Services/Basket/Basket.API/Controllers/BasketController.cs index c69d82a89..10036c283 100644 --- a/src/Services/Basket/Basket.API/Controllers/BasketController.cs +++ b/src/Services/Basket/Basket.API/Controllers/BasketController.cs @@ -21,14 +21,14 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers { private readonly IBasketRepository _repository; private readonly IIdentityService _identityService; - private readonly IEventBus _eventBus; + private readonly IMultiEventBus _eventBus; private readonly ILogger _logger; public BasketController( ILogger logger, IBasketRepository repository, IIdentityService identityService, - IEventBus eventBus) + IMultiEventBus eventBus) { _logger = logger; _repository = repository; diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index 731ae3d2c..8892b812a 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -86,7 +86,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API }); - if (Configuration.GetValue("AzureServiceBusEnabled")) + +/* if (Configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -97,8 +98,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); }); - } - else + }*/ +/* else { services.AddSingleton(sp => { @@ -120,7 +121,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API factory.Password = Configuration["EventBusPassword"]; } - //factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) @@ -133,7 +134,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); + });*/ services.AddSingleton(sp => { @@ -146,7 +147,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API }); - } + //} RegisterEventBus(services); @@ -324,7 +325,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API { var subscriptionClientName = Configuration["SubscriptionClientName"]; - if (Configuration.GetValue("AzureServiceBusEnabled")) + /*if (Configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -338,7 +339,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API }); } else - { + {*/ services.AddSingleton(sp => { @@ -354,10 +355,14 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API } List eventBuses = new List(); - multiRabbitMqPersistentConnections.GetConnections().ForEach(conn => + eventBuses.Add(new EventBusRabbitMQ(multiRabbitMqPersistentConnections.GetConnections()[0], logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount)); + eventBuses.Add(new EventBusRabbitMQ(multiRabbitMqPersistentConnections.GetConnections()[1], logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantB", subscriptionClientName, retryCount)); + + + /*multiRabbitMqPersistentConnections.GetConnections().ForEach(conn => { eventBuses.Add(new EventBusRabbitMQ(conn, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount)); - }); + });*/ return new MultiEventBusRabbitMQ(eventBuses); }); @@ -389,7 +394,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); });*/ - } + //} services.AddSingleton(); diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 36abdc927..c9955b7ac 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -311,7 +311,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API factory.Password = configuration["EventBusPassword"]; } - //factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) @@ -330,7 +330,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API { var subscriptionClientName = configuration["SubscriptionClientName"]; - if (configuration.GetValue("AzureServiceBusEnabled")) +/* if (configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -344,7 +344,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API }); } - else + else*/ { services.AddSingleton(sp => { @@ -359,7 +359,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API retryCount = int.Parse(configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } diff --git a/src/Services/Location/Locations.API/Startup.cs b/src/Services/Location/Locations.API/Startup.cs index 71ebf1fa7..06f9d55af 100644 --- a/src/Services/Location/Locations.API/Startup.cs +++ b/src/Services/Location/Locations.API/Startup.cs @@ -91,7 +91,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API factory.Password = Configuration["EventBusPassword"]; } - //factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) @@ -246,7 +246,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API { var subscriptionClientName = Configuration["SubscriptionClientName"]; - if (Configuration.GetValue("AzureServiceBusEnabled")) +/* if (Configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -259,7 +259,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); }); } - else + else*/ { services.AddSingleton(sp => { @@ -274,7 +274,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API retryCount = int.Parse(Configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } diff --git a/src/Services/Marketing/Marketing.API/Startup.cs b/src/Services/Marketing/Marketing.API/Startup.cs index 9db283bb5..4d190be1a 100644 --- a/src/Services/Marketing/Marketing.API/Startup.cs +++ b/src/Services/Marketing/Marketing.API/Startup.cs @@ -115,7 +115,7 @@ factory.Password = Configuration["EventBusPassword"]; } - // factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) @@ -260,7 +260,7 @@ { var subscriptionClientName = Configuration["SubscriptionClientName"]; - if (Configuration.GetValue("AzureServiceBusEnabled")) +/* if (Configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -273,7 +273,7 @@ eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); }); } - else + else*/ { services.AddSingleton(sp => { @@ -288,7 +288,7 @@ retryCount = int.Parse(Configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index e3852dac8..9c4e25aea 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -319,7 +319,7 @@ factory.Password = configuration["EventBusPassword"]; } - //factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; @@ -364,7 +364,7 @@ { var subscriptionClientName = configuration["SubscriptionClientName"]; - if (configuration.GetValue("AzureServiceBusEnabled")) +/* if (configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -377,7 +377,7 @@ eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); }); } - else + else*/ { services.AddSingleton(sp => { @@ -392,7 +392,7 @@ retryCount = int.Parse(configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } diff --git a/src/Services/Ordering/Ordering.API/appsettings.json b/src/Services/Ordering/Ordering.API/appsettings.json index f74c312b1..ddb377d46 100644 --- a/src/Services/Ordering/Ordering.API/appsettings.json +++ b/src/Services/Ordering/Ordering.API/appsettings.json @@ -6,10 +6,10 @@ "SeqServerUrl": null, "LogstashgUrl": null, "MinimumLevel": { - "Default": "Information", + "Default": "Verbose", "Override": { "Microsoft": "Warning", - "Microsoft.eShopOnContainers": "Information", + "Microsoft.eShopOnContainers": "Verbose", "System": "Warning" } } diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs index 4da64452d..408cf42cd 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs @@ -81,6 +81,8 @@ namespace Ordering.BackgroundTasks { factory.Password = Configuration["EventBusPassword"]; } + + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) @@ -123,7 +125,7 @@ namespace Ordering.BackgroundTasks { var subscriptionClientName = Configuration["SubscriptionClientName"]; - if (Configuration.GetValue("AzureServiceBusEnabled")) +/* if (Configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -136,7 +138,7 @@ namespace Ordering.BackgroundTasks eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); }); } - else + else*/ { services.AddSingleton(sp => { @@ -151,7 +153,7 @@ namespace Ordering.BackgroundTasks retryCount = int.Parse(Configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } diff --git a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs index f69ac78f3..4929ffed0 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs @@ -94,7 +94,7 @@ namespace Ordering.SignalrHub factory.Password = Configuration["EventBusPassword"]; } - //factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) @@ -195,7 +195,7 @@ namespace Ordering.SignalrHub { var subscriptionClientName = Configuration["SubscriptionClientName"]; - if (Configuration.GetValue("AzureServiceBusEnabled")) +/* if (Configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -208,7 +208,7 @@ namespace Ordering.SignalrHub eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); }); } - else + else*/ { services.AddSingleton(sp => { @@ -223,7 +223,7 @@ namespace Ordering.SignalrHub retryCount = int.Parse(Configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } diff --git a/src/Services/Payment/Payment.API/Startup.cs b/src/Services/Payment/Payment.API/Startup.cs index 1e0a35e42..5692f6826 100644 --- a/src/Services/Payment/Payment.API/Startup.cs +++ b/src/Services/Payment/Payment.API/Startup.cs @@ -72,7 +72,7 @@ namespace Payment.API factory.Password = Configuration["EventBusPassword"]; } - // factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) @@ -140,7 +140,7 @@ namespace Payment.API { var subscriptionClientName = Configuration["SubscriptionClientName"]; - if (Configuration.GetValue("AzureServiceBusEnabled")) +/* if (Configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -153,7 +153,7 @@ namespace Payment.API eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); }); } - else + else*/ { services.AddSingleton(sp => { @@ -168,7 +168,7 @@ namespace Payment.API retryCount = int.Parse(Configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } diff --git a/src/Services/TenantCustomisations/TenantACustomisations/Startup.cs b/src/Services/TenantCustomisations/TenantACustomisations/Startup.cs index f99fc8be0..b61568d67 100644 --- a/src/Services/TenantCustomisations/TenantACustomisations/Startup.cs +++ b/src/Services/TenantCustomisations/TenantACustomisations/Startup.cs @@ -311,7 +311,7 @@ factory.Password = configuration["EventBusPassword"]; } - //factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) @@ -355,7 +355,7 @@ { var subscriptionClientName = configuration["SubscriptionClientName"]; - if (configuration.GetValue("AzureServiceBusEnabled")) +/* if (configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -368,7 +368,7 @@ eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); }); } - else + else*/ { services.AddSingleton(sp => { @@ -383,7 +383,7 @@ retryCount = int.Parse(configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 8599657f9..e54163bc6 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -232,7 +232,7 @@ namespace Webhooks.API { var subscriptionClientName = configuration["SubscriptionClientName"]; - if (configuration.GetValue("AzureServiceBusEnabled")) +/* if (configuration.GetValue("AzureServiceBusEnabled")) { services.AddSingleton(sp => { @@ -246,7 +246,7 @@ namespace Webhooks.API }); } - else + else*/ { services.AddSingleton(sp => { @@ -261,7 +261,7 @@ namespace Webhooks.API retryCount = int.Parse(configuration["EventBusRetryCount"]); } - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, "TenantA", subscriptionClientName, retryCount); }); } @@ -336,7 +336,7 @@ namespace Webhooks.API factory.Password = configuration["EventBusPassword"]; } - //factory.VirtualHost = "customisation"; + factory.VirtualHost = "TenantA"; var retryCount = 5; if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"]))