diff --git a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs index dde05e1e3..6a8bc41eb 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs @@ -20,5 +20,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions void Unsubscribe() where TH : IIntegrationEventHandler where T : IntegrationEvent; + + void Start(); } } diff --git a/src/BuildingBlocks/EventBus/EventBusDependencyInjection/EventBusDependencyInjection.csproj b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/EventBusDependencyInjection.csproj new file mode 100644 index 000000000..a6e3d406e --- /dev/null +++ b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/EventBusDependencyInjection.csproj @@ -0,0 +1,17 @@ + + + + netstandard2.1 + + + + + + + + + + + + + diff --git a/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusBuilderExtensions.cs b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusBuilderExtensions.cs new file mode 100644 index 000000000..369f7669e --- /dev/null +++ b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusBuilderExtensions.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.AspNetCore.Builder +{ + public static class EventBusBuilderExtensions + { + public static IApplicationBuilder UseEventBus(this IApplicationBuilder builder, Action configure = null) + { + + var eventBus = builder.ApplicationServices.GetRequiredService(); + + configure?.Invoke(eventBus); + + eventBus.Start(); + + return builder; + + } + } +} diff --git a/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusRabbitMqServiceCollectionExtensions.cs b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusRabbitMqServiceCollectionExtensions.cs new file mode 100644 index 000000000..66496002f --- /dev/null +++ b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusRabbitMqServiceCollectionExtensions.cs @@ -0,0 +1,84 @@ + +namespace Microsoft.Extensions.DependencyInjection +{ + using Autofac; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; + using Microsoft.Extensions.Configuration; + using Microsoft.Extensions.DependencyInjection; + using Microsoft.Extensions.Logging; + using RabbitMQ.Client; + using System.Linq; + using System.Reflection; + + public static class EventBusRabbitMqServiceCollectionExtensions + { + public static IServiceCollection AddEventBusRabbitMq(this IServiceCollection services, IConfiguration configuration) + { + services.AddRabbitMQ(configuration); + + var subscriptionClientName = configuration["SubscriptionClientName"]; + + services.AddSingleton(sp => + { + var rabbitMQPersistentConnection = sp.GetRequiredService(); + var iLifetimeScope = sp.GetRequiredService(); + var logger = sp.GetRequiredService>(); + var eventBusSubcriptionsManager = sp.GetRequiredService(); + + var retryCount = 5; + if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) + { + retryCount = int.Parse(configuration["EventBusRetryCount"]); + } + + return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); + }); + + services.AddSingleton(); + + return services; + } + + private static IServiceCollection AddRabbitMQ(this IServiceCollection services, IConfiguration Configuration) + { + services.AddSingleton(sp => + { + var logger = sp.GetRequiredService>(); + + + var factory = new ConnectionFactory() + { + HostName = Configuration["EventBusConnection"], + DispatchConsumersAsync = true + }; + + if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) + { + factory.UserName = Configuration["EventBusUserName"]; + } + + if (!string.IsNullOrEmpty(Configuration["EventBusPassword"])) + { + factory.Password = Configuration["EventBusPassword"]; + } + + var retryCount = 5; + if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) + { + retryCount = int.Parse(Configuration["EventBusRetryCount"]); + } + + return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); + }); + + return services; + } + + + + + } +} + diff --git a/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusServiceBusServiceCollectionExtensions.cs b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusServiceBusServiceCollectionExtensions.cs new file mode 100644 index 000000000..8a7683e0d --- /dev/null +++ b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusServiceBusServiceCollectionExtensions.cs @@ -0,0 +1,59 @@ + +namespace Microsoft.Extensions.DependencyInjection +{ + using Autofac; + using Microsoft.Azure.ServiceBus; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; + using Microsoft.Extensions.Configuration; + using Microsoft.Extensions.DependencyInjection; + using Microsoft.Extensions.Logging; + using System.Linq; + using System.Reflection; + public static class EventBusServiceBusServiceCollectionExtensions + { + public static IServiceCollection AddEventBusServiceBus(this IServiceCollection services, IConfiguration configuration) + { + services.AddServiceBus(configuration); + + var subscriptionClientName = configuration["SubscriptionClientName"]; + + services.AddSingleton(sp => + { + var serviceBusPersisterConnection = sp.GetRequiredService(); + var iLifetimeScope = sp.GetRequiredService(); + var logger = sp.GetRequiredService>(); + var eventBusSubcriptionsManager = sp.GetRequiredService(); + + return new EventBusServiceBus(serviceBusPersisterConnection, logger, + eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); + }); + + + services.AddSingleton(); + + return services; + } + + private static IServiceCollection AddServiceBus(this IServiceCollection services, IConfiguration Configuration) + { + services.AddSingleton(sp => + { + var logger = sp.GetRequiredService>(); + + var serviceBusConnectionString = Configuration["EventBusConnection"]; + var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString); + + return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); + }); + + return services; + } + + + + + } +} + diff --git a/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusServiceCollectionExtensions.cs b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusServiceCollectionExtensions.cs new file mode 100644 index 000000000..6aa002129 --- /dev/null +++ b/src/BuildingBlocks/EventBus/EventBusDependencyInjection/Extensions/EventBusServiceCollectionExtensions.cs @@ -0,0 +1,38 @@ + +namespace Microsoft.Extensions.DependencyInjection +{ + using Autofac; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; + using Microsoft.Extensions.Configuration; + using Microsoft.Extensions.DependencyInjection; + using Microsoft.Extensions.Logging; + using RabbitMQ.Client; + using System.Linq; + using System.Reflection; + + public static class EventBusServiceCollectionExtensions + { + public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration) + { + if (configuration.GetValue("AzureServiceBusEnabled")) + { + services.AddEventBusServiceBus(configuration); + } + else + { + services.AddEventBusRabbitMq(configuration); + } + + return services; + } + + + + + + + } +} + diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs index 5623549d5..e9f5e190f 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs @@ -39,12 +39,18 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _subsManager = subsManager ?? new InMemoryEventBusSubscriptionsManager(); _queueName = queueName; - _consumerChannel = CreateConsumerChannel(); _autofac = autofac; _retryCount = retryCount; - _subsManager.OnEventRemoved += SubsManager_OnEventRemoved; } + public void Start() + { + _consumerChannel = CreateConsumerChannel(); + _subsManager.OnEventRemoved += SubsManager_OnEventRemoved; + + // There might be some messages already on the bus + StartBasicConsume(); + } private void SubsManager_OnEventRemoved(object sender, string eventName) { if (!_persistentConnection.IsConnected) diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs index 53ae33ae0..3451046b5 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs @@ -35,6 +35,10 @@ _autofac = autofac; RemoveDefaultRule(); + } + + public void Start() + { RegisterSubscriptionClientMessageHandler(); } diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index b0e9ca4ca..18f12a696 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -49,6 +49,7 @@ + diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index d9554bcb8..7eadb65c2 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -119,53 +119,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API return ConnectionMultiplexer.Connect(configuration); }); - - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var serviceBusConnectionString = Configuration["EventBusConnection"]; - var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString); - - return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); - }); - } - else - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var factory = new ConnectionFactory() - { - HostName = Configuration["EventBusConnection"], - DispatchConsumersAsync = true - }; - - if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) - { - factory.UserName = Configuration["EventBusUserName"]; - } - - if (!string.IsNullOrEmpty(Configuration["EventBusPassword"])) - { - factory.Password = Configuration["EventBusPassword"]; - } - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); - } - - RegisterEventBus(services); - + services.AddEventBus(Configuration); + services.AddIntegrationEventHandlers(); services.AddCors(options => { @@ -284,59 +239,24 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API app.UseAuthorization(); } - private void RegisterEventBus(IServiceCollection services) - { - var subscriptionClientName = Configuration["SubscriptionClientName"]; - - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var serviceBusPersisterConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - return new EventBusServiceBus(serviceBusPersisterConnection, logger, - eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); - }); - } - else - { - services.AddSingleton(sp => - { - var rabbitMQPersistentConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); - }); - } - - services.AddSingleton(); - - services.AddTransient(); - services.AddTransient(); - } - private void ConfigureEventBus(IApplicationBuilder app) { - var eventBus = app.ApplicationServices.GetRequiredService(); - - eventBus.Subscribe(); - eventBus.Subscribe(); + app.UseEventBus(eventBus => + { + eventBus.Subscribe(); + eventBus.Subscribe(); + }); } } public static class CustomExtensionMethods { + public static IServiceCollection AddIntegrationEventHandlers(this IServiceCollection services) + { + return services + .AddTransient() + .AddTransient(); + } public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) { var hcBuilder = services.AddHealthChecks(); diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index a2c32d99b..ef0e08379 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -69,6 +69,7 @@ + diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 53a9554be..1b319f895 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -51,8 +51,9 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API .AddCustomMVC(Configuration) .AddCustomDbContext(Configuration) .AddCustomOptions(Configuration) - .AddIntegrationServices(Configuration) .AddEventBus(Configuration) + .AddIntegrationEventHandlers(Configuration) + .AddIntegrationServices(Configuration) .AddSwagger(Configuration) .AddCustomHealthCheck(Configuration); @@ -120,9 +121,11 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API protected virtual void ConfigureEventBus(IApplicationBuilder app) { - var eventBus = app.ApplicationServices.GetRequiredService(); - eventBus.Subscribe(); - eventBus.Subscribe(); + app.UseEventBus(eventBus => + { + eventBus.Subscribe(); + eventBus.Subscribe(); + }); } } @@ -276,92 +279,12 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API services.AddTransient(); - if (configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var settings = sp.GetRequiredService>().Value; - var logger = sp.GetRequiredService>(); - - var serviceBusConnection = new ServiceBusConnectionStringBuilder(settings.EventBusConnection); - - return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); - }); - } - else - { - services.AddSingleton(sp => - { - var settings = sp.GetRequiredService>().Value; - var logger = sp.GetRequiredService>(); - - var factory = new ConnectionFactory() - { - HostName = configuration["EventBusConnection"], - DispatchConsumersAsync = true - }; - - if (!string.IsNullOrEmpty(configuration["EventBusUserName"])) - { - factory.UserName = configuration["EventBusUserName"]; - } - - if (!string.IsNullOrEmpty(configuration["EventBusPassword"])) - { - factory.Password = configuration["EventBusPassword"]; - } - - var retryCount = 5; - if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(configuration["EventBusRetryCount"]); - } - - return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); - } - + return services; } - public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration) + public static IServiceCollection AddIntegrationEventHandlers(this IServiceCollection services, IConfiguration configuration) { - var subscriptionClientName = configuration["SubscriptionClientName"]; - - if (configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var serviceBusPersisterConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - return new EventBusServiceBus(serviceBusPersisterConnection, logger, - eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); - }); - - } - else - { - services.AddSingleton(sp => - { - var rabbitMQPersistentConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - var retryCount = 5; - if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(configuration["EventBusRetryCount"]); - } - - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); - }); - } - - services.AddSingleton(); services.AddTransient(); services.AddTransient(); diff --git a/src/Services/Location/Locations.API/Locations.API.csproj b/src/Services/Location/Locations.API/Locations.API.csproj index d4899becb..4c37efd1e 100644 --- a/src/Services/Location/Locations.API/Locations.API.csproj +++ b/src/Services/Location/Locations.API/Locations.API.csproj @@ -37,6 +37,7 @@ + diff --git a/src/Services/Location/Locations.API/Startup.cs b/src/Services/Location/Locations.API/Startup.cs index 4f79b8977..a2bd870f4 100644 --- a/src/Services/Location/Locations.API/Startup.cs +++ b/src/Services/Location/Locations.API/Startup.cs @@ -56,51 +56,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API services.Configure(Configuration); - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var serviceBusConnectionString = Configuration["EventBusConnection"]; - var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString); - - return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); - }); - } - else - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var factory = new ConnectionFactory() - { - HostName = Configuration["EventBusConnection"], - DispatchConsumersAsync = true - }; - - if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) - { - factory.UserName = Configuration["EventBusUserName"]; - } - - if (!string.IsNullOrEmpty(Configuration["EventBusPassword"])) - { - factory.Password = Configuration["EventBusPassword"]; - } - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); - } - - RegisterEventBus(services); + services.AddEventBus(Configuration); // Add framework services. services.AddSwaggerGen(options => @@ -188,6 +144,8 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API }); }); + app.UseEventBus(); + app.UseSwagger() .UseSwaggerUI(c => { @@ -235,44 +193,6 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API app.UseAuthorization(); } - private void RegisterEventBus(IServiceCollection services) - { - var subscriptionClientName = Configuration["SubscriptionClientName"]; - - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var serviceBusPersisterConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - return new EventBusServiceBus(serviceBusPersisterConnection, logger, - eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); - }); - } - else - { - services.AddSingleton(sp => - { - var rabbitMQPersistentConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); - }); - } - - services.AddSingleton(); - } } public static class CustomExtensionMethods diff --git a/src/Services/Marketing/Marketing.API/Marketing.API.csproj b/src/Services/Marketing/Marketing.API/Marketing.API.csproj index bc3116fc3..28e4f59b1 100644 --- a/src/Services/Marketing/Marketing.API/Marketing.API.csproj +++ b/src/Services/Marketing/Marketing.API/Marketing.API.csproj @@ -53,6 +53,7 @@ + diff --git a/src/Services/Marketing/Marketing.API/Startup.cs b/src/Services/Marketing/Marketing.API/Startup.cs index 4c2c2a710..41070bb0f 100644 --- a/src/Services/Marketing/Marketing.API/Startup.cs +++ b/src/Services/Marketing/Marketing.API/Startup.cs @@ -79,52 +79,10 @@ //Check Client vs. Server evaluation: https://docs.microsoft.com/en-us/ef/core/querying/client-eval }); - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var serviceBusConnectionString = Configuration["EventBusConnection"]; - var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString); - - return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); - }); - } - else - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var factory = new ConnectionFactory() - { - HostName = Configuration["EventBusConnection"], - DispatchConsumersAsync = true - }; - - if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) - { - factory.UserName = Configuration["EventBusUserName"]; - } - - if (!string.IsNullOrEmpty(Configuration["EventBusPassword"])) - { - factory.Password = Configuration["EventBusPassword"]; - } - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); - } + services.AddEventBus(Configuration); + services.AddIntegrationEventHandlers(); // Add framework services. - AddCustomSwagger(services); services.AddCors(options => { @@ -136,8 +94,6 @@ .AllowCredentials()); }); - RegisterEventBus(services); - services.AddTransient(); services.AddSingleton(); services.AddTransient(); @@ -252,50 +208,13 @@ }); } - private void RegisterEventBus(IServiceCollection services) - { - var subscriptionClientName = Configuration["SubscriptionClientName"]; - - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var serviceBusPersisterConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - return new EventBusServiceBus(serviceBusPersisterConnection, logger, - eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); - }); - } - else - { - services.AddSingleton(sp => - { - var rabbitMQPersistentConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); - }); - } - services.AddSingleton(); - services.AddTransient(); - } private void ConfigureEventBus(IApplicationBuilder app) { - var eventBus = app.ApplicationServices.GetRequiredService(); - eventBus.Subscribe(); + app.UseEventBus(eventBus => + eventBus.Subscribe() + ); } protected virtual void ConfigureAuth(IApplicationBuilder app) @@ -312,6 +231,12 @@ public static class CustomExtensionMethods { + public static IServiceCollection AddIntegrationEventHandlers(this IServiceCollection services) + { + services.AddTransient(); + return services; + } + public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) { var hcBuilder = services.AddHealthChecks(); diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index c212bfe05..3ab5810a3 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -27,6 +27,7 @@ + diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index 3ccf16d54..db56c20c5 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -62,6 +62,7 @@ .AddCustomDbContext(Configuration) .AddCustomSwagger(Configuration) .AddCustomIntegrations(Configuration) + .AddEventBus(Configuration) .AddCustomConfiguration(Configuration) .AddEventBus(Configuration) .AddCustomAuthentication(Configuration); @@ -138,14 +139,16 @@ private void ConfigureEventBus(IApplicationBuilder app) { - var eventBus = app.ApplicationServices.GetRequiredService(); - - eventBus.Subscribe>(); - eventBus.Subscribe>(); - eventBus.Subscribe>(); - eventBus.Subscribe>(); - eventBus.Subscribe>(); - eventBus.Subscribe>(); + app.UseEventBus(eventBus => + { + eventBus.Subscribe>(); + eventBus.Subscribe>(); + eventBus.Subscribe>(); + eventBus.Subscribe>(); + eventBus.Subscribe>(); + eventBus.Subscribe>(); + }); + } protected virtual void ConfigureAuth(IApplicationBuilder app) @@ -301,51 +304,6 @@ services.AddTransient(); - if (configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var serviceBusConnectionString = configuration["EventBusConnection"]; - var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString); - - return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); - }); - } - else - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - - var factory = new ConnectionFactory() - { - HostName = configuration["EventBusConnection"], - DispatchConsumersAsync = true - }; - - if (!string.IsNullOrEmpty(configuration["EventBusUserName"])) - { - factory.UserName = configuration["EventBusUserName"]; - } - - if (!string.IsNullOrEmpty(configuration["EventBusPassword"])) - { - factory.Password = configuration["EventBusPassword"]; - } - - var retryCount = 5; - if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(configuration["EventBusRetryCount"]); - } - - return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); - } - return services; } @@ -374,46 +332,6 @@ return services; } - public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration) - { - var subscriptionClientName = configuration["SubscriptionClientName"]; - - if (configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var serviceBusPersisterConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - return new EventBusServiceBus(serviceBusPersisterConnection, logger, - eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); - }); - } - else - { - services.AddSingleton(sp => - { - var rabbitMQPersistentConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - var retryCount = 5; - if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(configuration["EventBusRetryCount"]); - } - - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); - }); - } - - services.AddSingleton(); - - return services; - } public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration) { diff --git a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj index ebe4cb70e..8c6a59a51 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj +++ b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj @@ -36,6 +36,7 @@ + diff --git a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs index cec48c4d2..5b6d01600 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs @@ -59,55 +59,10 @@ namespace Ordering.SignalrHub services.AddSignalR(); } - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var serviceBusConnectionString = Configuration["EventBusConnection"]; - var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString); - - return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); - }); - } - else - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - - var factory = new ConnectionFactory() - { - HostName = Configuration["EventBusConnection"], - DispatchConsumersAsync = true - }; - - if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) - { - factory.UserName = Configuration["EventBusUserName"]; - } - - if (!string.IsNullOrEmpty(Configuration["EventBusPassword"])) - { - factory.Password = Configuration["EventBusPassword"]; - } - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); - } ConfigureAuthService(services); - RegisterEventBus(services); - + services.AddEventBus(Configuration); services.AddOptions(); //configure autofac @@ -159,14 +114,16 @@ namespace Ordering.SignalrHub private void ConfigureEventBus(IApplicationBuilder app) { - var eventBus = app.ApplicationServices.GetRequiredService(); + app.UseEventBus(eventBus => + { + eventBus.Subscribe(); + eventBus.Subscribe(); + eventBus.Subscribe(); + eventBus.Subscribe(); + eventBus.Subscribe(); + eventBus.Subscribe(); - eventBus.Subscribe(); - eventBus.Subscribe(); - eventBus.Subscribe(); - eventBus.Subscribe(); - eventBus.Subscribe(); - eventBus.Subscribe(); + }); } private void ConfigureAuthService(IServiceCollection services) @@ -188,45 +145,6 @@ namespace Ordering.SignalrHub options.Audience = "orders.signalrhub"; }); } - - private void RegisterEventBus(IServiceCollection services) - { - var subscriptionClientName = Configuration["SubscriptionClientName"]; - - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var serviceBusPersisterConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - return new EventBusServiceBus(serviceBusPersisterConnection, logger, - eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); - }); - } - else - { - services.AddSingleton(sp => - { - var rabbitMQPersistentConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); - }); - } - - services.AddSingleton(); - } } public static class CustomExtensionMethods diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index 10f0e261a..249109115 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -29,6 +29,7 @@ + diff --git a/src/Services/Payment/Payment.API/Startup.cs b/src/Services/Payment/Payment.API/Startup.cs index 77b8d55fd..5328ca2f0 100644 --- a/src/Services/Payment/Payment.API/Startup.cs +++ b/src/Services/Payment/Payment.API/Startup.cs @@ -33,54 +33,10 @@ namespace Payment.API { services.AddCustomHealthCheck(Configuration); services.Configure(Configuration); + services.AddIntegrationEventHandlers(); RegisterAppInsights(services); - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var serviceBusConnectionString = Configuration["EventBusConnection"]; - var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString); - - return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); - }); - } - else - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - var factory = new ConnectionFactory() - { - HostName = Configuration["EventBusConnection"], - DispatchConsumersAsync = true - }; - - if (!string.IsNullOrEmpty(Configuration["EventBusUserName"])) - { - factory.UserName = Configuration["EventBusUserName"]; - } - - if (!string.IsNullOrEmpty(Configuration["EventBusPassword"])) - { - factory.Password = Configuration["EventBusPassword"]; - } - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); - } - - RegisterEventBus(services); - var container = new ContainerBuilder(); container.Populate(services); return new AutofacServiceProvider(container.Build()); @@ -120,56 +76,23 @@ namespace Payment.API services.AddApplicationInsightsTelemetry(Configuration); services.AddApplicationInsightsKubernetesEnricher(); } - - private void RegisterEventBus(IServiceCollection services) - { - var subscriptionClientName = Configuration["SubscriptionClientName"]; - - if (Configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var serviceBusPersisterConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - return new EventBusServiceBus(serviceBusPersisterConnection, logger, - eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); - }); - } - else - { - services.AddSingleton(sp => - { - var rabbitMQPersistentConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - var retryCount = 5; - if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(Configuration["EventBusRetryCount"]); - } - - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); - }); - } - - services.AddTransient(); - services.AddSingleton(); - } - private void ConfigureEventBus(IApplicationBuilder app) { - var eventBus = app.ApplicationServices.GetRequiredService(); - eventBus.Subscribe(); + app.UseEventBus(eventBus => + { + eventBus.Subscribe(); + }); } } public static class CustomExtensionMethods { + public static IServiceCollection AddIntegrationEventHandlers(this IServiceCollection services) + { + services.AddTransient(); + + return services; + } public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) { var hcBuilder = services.AddHealthChecks(); diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 7833133d5..9b8d903d0 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -52,8 +52,8 @@ namespace Webhooks.API .AddCustomHealthCheck(Configuration) .AddDevspaces() .AddHttpClientServices(Configuration) - .AddIntegrationServices(Configuration) .AddEventBus(Configuration) + .AddIntegrationEventHandlers() .AddCustomAuthentication(Configuration) .AddSingleton() .AddTransient() @@ -121,18 +121,28 @@ namespace Webhooks.API app.UseAuthentication(); app.UseAuthorization(); } - + protected virtual void ConfigureEventBus(IApplicationBuilder app) { - var eventBus = app.ApplicationServices.GetRequiredService(); - eventBus.Subscribe(); - eventBus.Subscribe(); - eventBus.Subscribe(); + app.UseEventBus(eventBus => + { + eventBus.Subscribe(); + eventBus.Subscribe(); + eventBus.Subscribe(); + }); } } static class CustomExtensionMethods { + public static IServiceCollection AddIntegrationEventHandlers(this IServiceCollection services) + { + return services + .AddTransient() + .AddTransient() + .AddTransient(); + } + public static IServiceCollection AddAppInsight(this IServiceCollection services, IConfiguration configuration) { services.AddApplicationInsightsTelemetry(configuration); @@ -217,49 +227,6 @@ namespace Webhooks.API return services; } - public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration) - { - var subscriptionClientName = configuration["SubscriptionClientName"]; - - if (configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var serviceBusPersisterConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - return new EventBusServiceBus(serviceBusPersisterConnection, logger, - eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope); - }); - - } - else - { - services.AddSingleton(sp => - { - var rabbitMQPersistentConnection = sp.GetRequiredService(); - var iLifetimeScope = sp.GetRequiredService(); - var logger = sp.GetRequiredService>(); - var eventBusSubcriptionsManager = sp.GetRequiredService(); - - var retryCount = 5; - if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(configuration["EventBusRetryCount"]); - } - - return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount); - }); - } - - services.AddSingleton(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - return services; - } public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) { @@ -289,55 +256,6 @@ namespace Webhooks.API return services; } - public static IServiceCollection AddIntegrationServices(this IServiceCollection services, IConfiguration configuration) - { - services.AddTransient>( - sp => (DbConnection c) => new IntegrationEventLogService(c)); - - if (configuration.GetValue("AzureServiceBusEnabled")) - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - var serviceBusConnection = new ServiceBusConnectionStringBuilder(configuration["EventBusConnection"]); - return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger); - }); - } - else - { - services.AddSingleton(sp => - { - var logger = sp.GetRequiredService>(); - - var factory = new ConnectionFactory() - { - HostName = configuration["EventBusConnection"], - DispatchConsumersAsync = true - }; - - if (!string.IsNullOrEmpty(configuration["EventBusUserName"])) - { - factory.UserName = configuration["EventBusUserName"]; - } - - if (!string.IsNullOrEmpty(configuration["EventBusPassword"])) - { - factory.Password = configuration["EventBusPassword"]; - } - - var retryCount = 5; - if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"])) - { - retryCount = int.Parse(configuration["EventBusRetryCount"]); - } - - return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount); - }); - } - - return services; - } - public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration) { // prevent from mapping "sub" claim to nameidentifier. diff --git a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj index 6624001c4..29aacecc1 100644 --- a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj +++ b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj @@ -27,6 +27,7 @@ + diff --git a/src/eShopOnContainers-ServicesAndWebApps.sln b/src/eShopOnContainers-ServicesAndWebApps.sln index 3a1dec68a..af04159eb 100644 --- a/src/eShopOnContainers-ServicesAndWebApps.sln +++ b/src/eShopOnContainers-ServicesAndWebApps.sln @@ -157,6 +157,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{3ABEEE EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ordering.BackgroundTasks", "Services\Ordering\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj", "{D4DBA4A3-E4A5-4D9D-8ACF-F38F7D506191}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventBusDependencyInjection", "BuildingBlocks\EventBus\EventBusDependencyInjection\EventBusDependencyInjection.csproj", "{3B82FD32-03B2-48D5-856D-17664C51F6A7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -1707,6 +1709,54 @@ Global {D4DBA4A3-E4A5-4D9D-8ACF-F38F7D506191}.Release|x64.Build.0 = Release|Any CPU {D4DBA4A3-E4A5-4D9D-8ACF-F38F7D506191}.Release|x86.ActiveCfg = Release|Any CPU {D4DBA4A3-E4A5-4D9D-8ACF-F38F7D506191}.Release|x86.Build.0 = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|ARM.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|iPhone.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|x64.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|x64.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|x86.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.AppStore|x86.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|ARM.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|ARM.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|iPhone.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|x64.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|x64.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|x86.ActiveCfg = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Debug|x86.Build.0 = Debug|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|Any CPU.Build.0 = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|ARM.ActiveCfg = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|ARM.Build.0 = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|iPhone.ActiveCfg = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|iPhone.Build.0 = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|x64.ActiveCfg = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|x64.Build.0 = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|x86.ActiveCfg = Release|Any CPU + {3B82FD32-03B2-48D5-856D-17664C51F6A7}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1772,6 +1822,7 @@ Global {882A8F3A-C61F-4C44-86DD-A5A258714BF2} = {77849D35-37D4-4802-81DC-9477B2775A40} {3ABEEE8C-35E0-4185-9825-C44326151F5B} = {882A8F3A-C61F-4C44-86DD-A5A258714BF2} {D4DBA4A3-E4A5-4D9D-8ACF-F38F7D506191} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} + {3B82FD32-03B2-48D5-856D-17664C51F6A7} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}