Merge branch 'dev' of https://github.com/dotnet/eShopOnContainers into AzureKeyVault
This commit is contained in:
commit
3f225e4be4
@ -146,6 +146,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{32EE4736
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{120CABB3-0FEA-4B40-B4B5-2D3041798C80}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{120CABB3-0FEA-4B40-B4B5-2D3041798C80}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Payment", "Payment", "{C61C5CFE-4876-4A46-A96E-5BBF596A984A}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Payment.API", "src\Services\Payment\Payment.API\Payment.API.csproj", "{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
|
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
|
||||||
@ -1792,6 +1796,54 @@ Global
|
|||||||
{639BB197-D112-47A7-A44A-471DDB0FA1AE}.Release|x64.Build.0 = Release|Any CPU
|
{639BB197-D112-47A7-A44A-471DDB0FA1AE}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{639BB197-D112-47A7-A44A-471DDB0FA1AE}.Release|x86.ActiveCfg = Release|Any CPU
|
{639BB197-D112-47A7-A44A-471DDB0FA1AE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{639BB197-D112-47A7-A44A-471DDB0FA1AE}.Release|x86.Build.0 = Release|Any CPU
|
{639BB197-D112-47A7-A44A-471DDB0FA1AE}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|ARM.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|ARM.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|iPhone.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|x64.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.AppStore|x86.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|ARM.Build.0 = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|iPhone.Build.0 = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -1856,6 +1908,8 @@ Global
|
|||||||
{C3F6ED48-E26D-4D57-970F-B82E69467BA1} = {41139F64-4046-4F16-96B7-D941D96FA9C6}
|
{C3F6ED48-E26D-4D57-970F-B82E69467BA1} = {41139F64-4046-4F16-96B7-D941D96FA9C6}
|
||||||
{32EE4736-7534-47EC-BAAD-C00AF3130F80} = {A5260DE0-1FDD-467E-9CC1-A028AB081CEE}
|
{32EE4736-7534-47EC-BAAD-C00AF3130F80} = {A5260DE0-1FDD-467E-9CC1-A028AB081CEE}
|
||||||
{120CABB3-0FEA-4B40-B4B5-2D3041798C80} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
|
{120CABB3-0FEA-4B40-B4B5-2D3041798C80} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
|
||||||
|
{C61C5CFE-4876-4A46-A96E-5BBF596A984A} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
|
||||||
|
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84} = {C61C5CFE-4876-4A46-A96E-5BBF596A984A}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}
|
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# This heml values file defines app-based settings
|
# This helm values file defines app-based settings
|
||||||
# Charts use those values, so this file **MUST** be included in all chart releases
|
# Charts use those values, so this file **MUST** be included in all chart releases
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace EventBus.Tests
|
namespace EventBus.Tests
|
||||||
{
|
{
|
||||||
public class TestIntegrationOtherEventHandler : IIntegrationEventHandler<TestIntegrationEvent>
|
public class TestIntegrationEventHandler : IIntegrationEventHandler<TestIntegrationEvent>
|
||||||
{
|
{
|
||||||
public bool Handled { get; private set; }
|
public bool Handled { get; private set; }
|
||||||
|
|
||||||
public TestIntegrationOtherEventHandler()
|
public TestIntegrationEventHandler()
|
||||||
{
|
{
|
||||||
Handled = false;
|
Handled = false;
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,11 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace EventBus.Tests
|
namespace EventBus.Tests
|
||||||
{
|
{
|
||||||
public class TestIntegrationEventHandler : IIntegrationEventHandler<TestIntegrationEvent>
|
public class TestIntegrationOtherEventHandler : IIntegrationEventHandler<TestIntegrationEvent>
|
||||||
{
|
{
|
||||||
public bool Handled { get; private set; }
|
public bool Handled { get; private set; }
|
||||||
|
|
||||||
public TestIntegrationEventHandler()
|
public TestIntegrationOtherEventHandler()
|
||||||
{
|
{
|
||||||
Handled = false;
|
Handled = false;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
private readonly string AUTOFAC_SCOPE_NAME = "eshop_event_bus";
|
private readonly string AUTOFAC_SCOPE_NAME = "eshop_event_bus";
|
||||||
private const string INTEGRATION_EVENT_SUFIX = "IntegrationEvent";
|
private const string INTEGRATION_EVENT_SUFIX = "IntegrationEvent";
|
||||||
|
|
||||||
public EventBusServiceBus(IServiceBusPersisterConnection serviceBusPersisterConnection,
|
public EventBusServiceBus(IServiceBusPersisterConnection serviceBusPersisterConnection,
|
||||||
ILogger<EventBusServiceBus> logger, IEventBusSubscriptionsManager subsManager, string subscriptionClientName,
|
ILogger<EventBusServiceBus> logger, IEventBusSubscriptionsManager subsManager, string subscriptionClientName,
|
||||||
ILifetimeScope autofac)
|
ILifetimeScope autofac)
|
||||||
{
|
{
|
||||||
@ -30,7 +30,7 @@
|
|||||||
_logger = logger;
|
_logger = logger;
|
||||||
_subsManager = subsManager ?? new InMemoryEventBusSubscriptionsManager();
|
_subsManager = subsManager ?? new InMemoryEventBusSubscriptionsManager();
|
||||||
|
|
||||||
_subscriptionClient = new SubscriptionClient(serviceBusPersisterConnection.ServiceBusConnectionStringBuilder,
|
_subscriptionClient = new SubscriptionClient(serviceBusPersisterConnection.ServiceBusConnectionStringBuilder,
|
||||||
subscriptionClientName);
|
subscriptionClientName);
|
||||||
_autofac = autofac;
|
_autofac = autofac;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@
|
|||||||
where T : IntegrationEvent
|
where T : IntegrationEvent
|
||||||
where TH : IIntegrationEventHandler<T>
|
where TH : IIntegrationEventHandler<T>
|
||||||
{
|
{
|
||||||
var eventName = typeof(T).Name.Replace(INTEGRATION_EVENT_SUFIX, "");
|
var eventName = typeof(T).Name.Replace(INTEGRATION_EVENT_SUFIX, "");
|
||||||
|
|
||||||
var containsKey = _subsManager.HasSubscriptionsForEvent<T>();
|
var containsKey = _subsManager.HasSubscriptionsForEvent<T>();
|
||||||
if (!containsKey)
|
if (!containsKey)
|
||||||
@ -81,7 +81,7 @@
|
|||||||
Name = eventName
|
Name = eventName
|
||||||
}).GetAwaiter().GetResult();
|
}).GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
catch(ServiceBusException)
|
catch (ServiceBusException)
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"The messaging entity {eventName} already exists.");
|
_logger.LogInformation($"The messaging entity {eventName} already exists.");
|
||||||
}
|
}
|
||||||
@ -129,10 +129,12 @@
|
|||||||
{
|
{
|
||||||
var eventName = $"{message.Label}{INTEGRATION_EVENT_SUFIX}";
|
var eventName = $"{message.Label}{INTEGRATION_EVENT_SUFIX}";
|
||||||
var messageData = Encoding.UTF8.GetString(message.Body);
|
var messageData = Encoding.UTF8.GetString(message.Body);
|
||||||
await ProcessEvent(eventName, messageData);
|
|
||||||
|
|
||||||
// Complete the message so that it is not received again.
|
// Complete the message so that it is not received again.
|
||||||
await _subscriptionClient.CompleteAsync(message.SystemProperties.LockToken);
|
if (await ProcessEvent(eventName, messageData))
|
||||||
|
{
|
||||||
|
await _subscriptionClient.CompleteAsync(message.SystemProperties.LockToken);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new MessageHandlerOptions(ExceptionReceivedHandler) { MaxConcurrentCalls = 10, AutoComplete = false });
|
new MessageHandlerOptions(ExceptionReceivedHandler) { MaxConcurrentCalls = 10, AutoComplete = false });
|
||||||
}
|
}
|
||||||
@ -148,8 +150,9 @@
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ProcessEvent(string eventName, string message)
|
private async Task<bool> ProcessEvent(string eventName, string message)
|
||||||
{
|
{
|
||||||
|
var processed = false;
|
||||||
if (_subsManager.HasSubscriptionsForEvent(eventName))
|
if (_subsManager.HasSubscriptionsForEvent(eventName))
|
||||||
{
|
{
|
||||||
using (var scope = _autofac.BeginLifetimeScope(AUTOFAC_SCOPE_NAME))
|
using (var scope = _autofac.BeginLifetimeScope(AUTOFAC_SCOPE_NAME))
|
||||||
@ -173,7 +176,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
processed = true;
|
||||||
}
|
}
|
||||||
|
return processed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveDefaultRule()
|
private void RemoveDefaultRule()
|
||||||
@ -191,4 +196,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,7 +19,7 @@
|
|||||||
.UseContentRoot(Path.GetDirectoryName(path))
|
.UseContentRoot(Path.GetDirectoryName(path))
|
||||||
.ConfigureAppConfiguration(cb =>
|
.ConfigureAppConfiguration(cb =>
|
||||||
{
|
{
|
||||||
cb.AddJsonFile("Services/Locations/appsettings.json", optional: false)
|
cb.AddJsonFile("Services/Location/appsettings.json", optional: false)
|
||||||
.AddEnvironmentVariables();
|
.AddEnvironmentVariables();
|
||||||
}).UseStartup<LocationsTestsStartup>();
|
}).UseStartup<LocationsTestsStartup>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user