diff --git a/MessageQueueDemo.sln b/MessageQueueDemo.sln index d375bc3..800ae1c 100644 --- a/MessageQueueDemo.sln +++ b/MessageQueueDemo.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.13 +VisualStudioVersion = 15.0.26430.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9F74D311-DB70-4FA4-AE64-4FF6BAFB95A4}" EndProject @@ -15,11 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CHV.Infrastructure.MessageB EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CHV.Infrastructure.MessageBus.RabbitMq", "src\CHV.Infrastructure.MessageBus.RabbitMq\CHV.Infrastructure.MessageBus.RabbitMq.csproj", "{57F97F8E-C909-47E7-8E60-9E2E3341E76A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessageQueueDemo", "src\MessageQueueDemo\MessageQueueDemo.csproj", "{81CAB4A1-643D-42E4-B6CA-51BB4794C6EC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RabbitMq.SubscriberConsoleTests", "test\RabbitMq.SubscriberConsoleTests\RabbitMq.SubscriberConsoleTests.csproj", "{340FA942-A9F1-4B1B-8FD9-56D70E4DF5A9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RabbitMq.SubscriberConsoleTests", "test\RabbitMq.SubscriberConsoleTests\RabbitMq.SubscriberConsoleTests.csproj", "{340FA942-A9F1-4B1B-8FD9-56D70E4DF5A9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RabbitMq.PublisherConsoleTests", "test\RabbitMq.PublisherConsoleTests\RabbitMq.PublisherConsoleTests.csproj", "{89A30230-89F8-45B3-9252-12FD884C7D48}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RabbitMq.PublisherConsoleTests", "test\RabbitMq.PublisherConsoleTests\RabbitMq.PublisherConsoleTests.csproj", "{89A30230-89F8-45B3-9252-12FD884C7D48}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -43,10 +41,6 @@ Global {57F97F8E-C909-47E7-8E60-9E2E3341E76A}.Debug|Any CPU.Build.0 = Debug|Any CPU {57F97F8E-C909-47E7-8E60-9E2E3341E76A}.Release|Any CPU.ActiveCfg = Release|Any CPU {57F97F8E-C909-47E7-8E60-9E2E3341E76A}.Release|Any CPU.Build.0 = Release|Any CPU - {81CAB4A1-643D-42E4-B6CA-51BB4794C6EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {81CAB4A1-643D-42E4-B6CA-51BB4794C6EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {81CAB4A1-643D-42E4-B6CA-51BB4794C6EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {81CAB4A1-643D-42E4-B6CA-51BB4794C6EC}.Release|Any CPU.Build.0 = Release|Any CPU {340FA942-A9F1-4B1B-8FD9-56D70E4DF5A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {340FA942-A9F1-4B1B-8FD9-56D70E4DF5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU {340FA942-A9F1-4B1B-8FD9-56D70E4DF5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,7 +58,6 @@ Global {5A71E5B4-913C-4F7D-AA67-E61D3F549A17} = {9F74D311-DB70-4FA4-AE64-4FF6BAFB95A4} {0FEF98B9-0141-47D2-B00C-166EFD611280} = {9F74D311-DB70-4FA4-AE64-4FF6BAFB95A4} {57F97F8E-C909-47E7-8E60-9E2E3341E76A} = {9F74D311-DB70-4FA4-AE64-4FF6BAFB95A4} - {81CAB4A1-643D-42E4-B6CA-51BB4794C6EC} = {9F74D311-DB70-4FA4-AE64-4FF6BAFB95A4} {340FA942-A9F1-4B1B-8FD9-56D70E4DF5A9} = {87399E30-9721-4E12-AFCC-9530E4980FAC} {89A30230-89F8-45B3-9252-12FD884C7D48} = {87399E30-9721-4E12-AFCC-9530E4980FAC} EndGlobalSection diff --git a/src/CHV.Infrastructure.MessageBus.RabbitMq/PubSubClientBus.cs b/src/CHV.Infrastructure.MessageBus.RabbitMq/PubSubClientBus.cs index 5f9474a..74473bf 100644 --- a/src/CHV.Infrastructure.MessageBus.RabbitMq/PubSubClientBus.cs +++ b/src/CHV.Infrastructure.MessageBus.RabbitMq/PubSubClientBus.cs @@ -1,6 +1,5 @@ using Newtonsoft.Json; using RabbitMQ.Client; -using RabbitMQ.Client.Events; using System; using System.Reactive; using System.Reactive.Linq; @@ -16,6 +15,9 @@ public PubSubClientBus(string uri, string exchangeName = "", string exchangeType { } + /* + * Publish & Request need routingKey and exchangeName + */ public IObservable Publish(TMessage message) { return Observable.Start(() => @@ -26,6 +28,9 @@ public IObservable Publish(TMessage message) }); } + /* + * Subscribe & Respond need queueName + */ public IObservable Subscribe(Func subscribeHandler) { return Observable.Start(() => diff --git a/src/CHV.Infrastructure.MessageBus.RabbitMq/RequestClientBus.cs b/src/CHV.Infrastructure.MessageBus.RabbitMq/RequestClientBus.cs index 40ab6a0..987ba7d 100644 --- a/src/CHV.Infrastructure.MessageBus.RabbitMq/RequestClientBus.cs +++ b/src/CHV.Infrastructure.MessageBus.RabbitMq/RequestClientBus.cs @@ -32,7 +32,8 @@ protected override void CreateConsumer() } /* - * ~Publish + * Publish & Request need routingKey and exchangeName + * * Note: The client needs to create its consumer before publishing the request * (otherwise the broker can't substitute reply_to correctly, * and you see that ChannelClose exception as the result, diff --git a/src/CHV.Infrastructure.MessageBus.RabbitMq/RespondClientBus.cs b/src/CHV.Infrastructure.MessageBus.RabbitMq/RespondClientBus.cs index 66e5a9d..5379fbb 100644 --- a/src/CHV.Infrastructure.MessageBus.RabbitMq/RespondClientBus.cs +++ b/src/CHV.Infrastructure.MessageBus.RabbitMq/RespondClientBus.cs @@ -15,7 +15,7 @@ public RespondClientBus(string uri, string exchangeName = "", string exchangeTyp } /* - * ~Subscribe + * Subscribe & Respond need queueName */ public async Task RespondAsync(Func> respondHandler) { diff --git a/src/MessageQueueDemo/MessageQueueDemo.csproj b/src/MessageQueueDemo/MessageQueueDemo.csproj deleted file mode 100644 index 954020d..0000000 --- a/src/MessageQueueDemo/MessageQueueDemo.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - netstandard1.4 - - - \ No newline at end of file