Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit 4788539

Browse files
Merged ConnectionFactory features
2 parents d47595f + 4ec23c7 commit 4788539

21 files changed

+136
-40
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
**/.project
2-
**/.vs/
32
**/bin/
43
**/obj/
4+
**/.vs/
55
**/.vscode/
6+
**/.idea/
67
**/*.xproj.user
78
**/*.csproj.user

RabbitMQ.Client.Core.DependencyInjection.sln

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1515
EndProject
1616
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{19ADB6D2-AC61-476A-9FF4-F827574658C7}"
1717
EndProject
18-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.ConsumerHost", "src\Examples.ConsumerHost\Examples.ConsumerHost.csproj", "{10C10C9D-F2ED-43C8-B235-780DD75EF8E6}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.ConsumerHost", "examples\Examples.ConsumerHost\Examples.ConsumerHost.csproj", "{10C10C9D-F2ED-43C8-B235-780DD75EF8E6}"
1919
EndProject
20-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.ConsumerConsole", "src\Examples.ConsumerConsole\Examples.ConsumerConsole.csproj", "{6E75E157-373A-4056-898B-3713CDD5C06C}"
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.ConsumerConsole", "examples\Examples.ConsumerConsole\Examples.ConsumerConsole.csproj", "{6E75E157-373A-4056-898B-3713CDD5C06C}"
2121
EndProject
22-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.Producer", "src\Examples.Producer\Examples.Producer.csproj", "{1F81E848-7781-448F-BBBB-6A1E509B76CC}"
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.Producer", "examples\Examples.Producer\Examples.Producer.csproj", "{1F81E848-7781-448F-BBBB-6A1E509B76CC}"
23+
EndProject
24+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{04EFD8F7-5120-4072-9728-64203F6F4873}"
2325
EndProject
2426
Global
2527
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -49,9 +51,9 @@ Global
4951
EndGlobalSection
5052
GlobalSection(NestedProjects) = preSolution
5153
{0C8EA737-64AC-4C41-8F80-11BFFEE23CE2} = {19ADB6D2-AC61-476A-9FF4-F827574658C7}
52-
{10C10C9D-F2ED-43C8-B235-780DD75EF8E6} = {19ADB6D2-AC61-476A-9FF4-F827574658C7}
53-
{6E75E157-373A-4056-898B-3713CDD5C06C} = {19ADB6D2-AC61-476A-9FF4-F827574658C7}
54-
{1F81E848-7781-448F-BBBB-6A1E509B76CC} = {19ADB6D2-AC61-476A-9FF4-F827574658C7}
54+
{6E75E157-373A-4056-898B-3713CDD5C06C} = {04EFD8F7-5120-4072-9728-64203F6F4873}
55+
{10C10C9D-F2ED-43C8-B235-780DD75EF8E6} = {04EFD8F7-5120-4072-9728-64203F6F4873}
56+
{1F81E848-7781-448F-BBBB-6A1E509B76CC} = {04EFD8F7-5120-4072-9728-64203F6F4873}
5557
EndGlobalSection
5658
GlobalSection(ExtensibilityGlobals) = postSolution
5759
SolutionGuid = {0EBBD182-65B2-47F9-ABBE-64B5B8C9652F}

src/Examples.ConsumerConsole/CustomAsyncMessageHandler.cs renamed to examples/Examples.ConsumerConsole/CustomAsyncMessageHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public CustomAsyncMessageHandler(ILogger<CustomAsyncMessageHandler> logger)
1515

1616
public async Task Handle(string message, string routingKey)
1717
{
18-
await Task.Run(() => _logger.LogInformation("A weird example of runnig something async.")).ConfigureAwait(false);
18+
_logger.LogInformation($"A weird example of running something async with message {message}.");
1919
}
2020
}
2121
}

src/Examples.ConsumerConsole/CustomAsyncNonCyclicMessageHandler.cs renamed to examples/Examples.ConsumerConsole/CustomAsyncNonCyclicMessageHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public CustomAsyncNonCyclicMessageHandler(ILogger<CustomAsyncNonCyclicMessageHan
1515

1616
public async Task Handle(string message, string routingKey, IQueueService queueService)
1717
{
18-
_logger.LogInformation("A weird example of runnig something async.");
18+
_logger.LogInformation("A weird example of running something async.");
1919
var response = new { message, routingKey };
2020
await queueService.SendAsync(response, "exchange.name", "routing.key");
2121
}

src/Examples.ConsumerConsole/Examples.ConsumerConsole.csproj renamed to examples/Examples.ConsumerConsole/Examples.ConsumerConsole.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<ProjectReference Include="..\RabbitMQ.Client.Core.DependencyInjection\RabbitMQ.Client.Core.DependencyInjection.csproj" />
17+
<ProjectReference Include="..\..\src\RabbitMQ.Client.Core.DependencyInjection\RabbitMQ.Client.Core.DependencyInjection.csproj" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/Examples.ConsumerConsole/Program.cs renamed to examples/Examples.ConsumerConsole/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ static void ConfigureServices(IServiceCollection services)
3232

3333
services.AddRabbitMqClient(rabbitMqSection)
3434
.AddConsumptionExchange("exchange.name", exchangeSection)
35-
.AddAsyncMessageHandlerSingleton<CustomAsyncMessageHandler>("routing.key")
36-
.AddAsyncNonCyclicMessageHandlerSingleton<CustomAsyncNonCyclicMessageHandler>("routing.key");
35+
.AddAsyncMessageHandlerSingleton<CustomAsyncMessageHandler>("routing.key");
36+
//.AddAsyncNonCyclicMessageHandlerSingleton<CustomAsyncNonCyclicMessageHandler>("routing.key");
3737
}
3838
}
3939
}

src/Examples.ConsumerHost/appsettings.json renamed to examples/Examples.ConsumerConsole/appsettings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
}
66
},
77
"RabbitMq": {
8-
"HostName": "127.0.0.1",
8+
"TcpEndpoints": [
9+
{
10+
"HostName": "127.0.0.1",
11+
"Port": 5672
12+
}
13+
],
914
"Port": "5672",
1015
"UserName": "guest",
1116
"Password": "guest"

0 commit comments

Comments
 (0)