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

Commit e2e4fa6

Browse files
Fixed documentation
1 parent 7e8d026 commit e2e4fa6

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

docs/exchange-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class Startup
2525
services.AddRabbitMqClient(clientConfiguration)
2626
.AddExchange("ExchangeName", isConsuming: true, exchangeConfiguration);
2727
}
28-
28+
2929
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
3030
{
3131
}
@@ -134,7 +134,7 @@ services.AddRabbitMqClient(clientConfiguration)
134134
### Manual configuring
135135

136136
You can also configure exchanges manually passing instances of `RabbitMqExchangeOptions` and `RabbitMqQueueOptions` classes to one of the `AddExchange` methods.
137-
137+
138138
```c#
139139
var exchangeOptions = new RabbitMqExchangeOptions
140140
{

docs/message-consumption.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ public class ConsumingService : IHostedService
4040
{
4141
readonly IQueueService _queueService;
4242
readonly ILogger<ConsumingService> _logger;
43-
43+
4444
public ConsumingService(
4545
IQueueService queueService,
4646
ILogger<ConsumingService> logger)
4747
{
4848
_queueService = queueService;
4949
_logger = logger;
5050
}
51-
51+
5252
public Task StartAsync(CancellationToken cancellationToken)
5353
{
5454
_logger.LogInformation("Starting consuming.");
5555
_queueService.StartConsuming();
5656
return Task.CompletedTask;
5757
}
58-
58+
5959
public Task StopAsync(CancellationToken cancellationToken)
6060
{
6161
_logger.LogInformation("Stopping consuming.");
@@ -82,7 +82,7 @@ public class Program
8282
var exchangeConfiguration = hostContext.Configuration.GetSection("RabbitMqExchange");
8383
services.AddRabbitMqClient(clientConfiguration)
8484
.AddExchange("ExchangeName", isConsuming: true, exchangeConfiguration);
85-
85+
8686
// And add the background service.
8787
services.AddHostedService<Worker>();;
8888
});
@@ -139,7 +139,7 @@ RabbitMQ client and exchange configuration sections are not specified in this ex
139139
```c#
140140
services.AddRabbitMqClient(clientConfiguration)
141141
.AddExchange("ExchangeName", isConsuming: true, exchangeConfiguration)
142-
.AddMessageHandlerSingleton<CustomMessageHandler>("first.routing.key");
142+
.AddMessageHandlerSingleton<CustomMessageHandler>("first.routing.key")
143143
.AddMessageHandlerSingleton<AnotherCustomMessageHandler>(new[] { "second.routing.key", "third.routing.key" });
144144
```
145145

@@ -148,7 +148,7 @@ You can also use **pattern matching** in routes where `*` (star) can substitute
148148
```c#
149149
services.AddRabbitMqClient(clientConfiguration)
150150
.AddExchange("ExchangeName", isConsuming: true, exchangeConfiguration)
151-
.AddMessageHandlerSingleton<CustomMessageHandler>("*.routing.*");
151+
.AddMessageHandlerSingleton<CustomMessageHandler>("*.routing.*")
152152
.AddMessageHandlerSingleton<AnotherCustomMessageHandler>(new[] { "#.key", "third.*" });
153153
```
154154

@@ -157,7 +157,7 @@ You are also allowed to specify the exact exchange which will be "listened" by a
157157
```c#
158158
services.AddRabbitMqClient(clientConfiguration)
159159
.AddExchange("ExchangeName", isConsuming: true, exchangeConfiguration)
160-
.AddMessageHandlerSingleton<CustomMessageHandler>("*.*.*", "ExchangeName");
160+
.AddMessageHandlerSingleton<CustomMessageHandler>("*.*.*", "ExchangeName")
161161
.AddMessageHandlerSingleton<AnotherCustomMessageHandler>("routing.key", "ExchangeName");
162162
```
163163

@@ -170,7 +170,7 @@ services.AddRabbitMqClient(clientConfiguration)
170170
```
171171

172172
You can also set multiple message handlers for managing messages received by one routing key. This case can happen when you want to divide responsibilities between services (e.g. one contains business logic, and the other writes messages in the database).
173-
173+
174174
```c#
175175
services.AddRabbitMqClient(clientConfiguration)
176176
.AddExchange("ExchangeName", isConsuming: true, exchangeConfiguration)
@@ -203,7 +203,7 @@ public class CustomMessageHandler : IMessageHandler
203203
{
204204
_logger = logger;
205205
}
206-
206+
207207
public void Handle(string message, string routingKey)
208208
{
209209
_logger.LogInformation($"I got a message {message} by routing key {routingKey}");
@@ -231,7 +231,7 @@ public class CustomNonCyclicMessageHandler : INonCyclicMessageHandler
231231
{
232232
_logger = logger;
233233
}
234-
234+
235235
public void Handle(string message, string routingKey, IQueueService queueService)
236236
{
237237
_logger.LogInformation("Got a message. I will send it back to another queue.");
@@ -259,12 +259,12 @@ services.AddRabbitMqClient(clientConfiguration)
259259
public class CustomAsyncMessageHandler : IAsyncMessageHandler
260260
{
261261
readonly ILogger<CustomAsyncMessageHandler> _logger;
262-
262+
263263
public CustomAsyncMessageHandler(ILogger<CustomAsyncMessageHandler> logger)
264264
{
265265
_logger = logger;
266266
}
267-
267+
268268
public async Task Handle(string message, string routingKey)
269269
{
270270
// Do whatever you want asynchronously!
@@ -278,12 +278,12 @@ And `IAsyncNonCyclicMessageHandler` will be as in example below.
278278
public class CustomAsyncNonCyclicMessageHandler : IAsyncNonCyclicMessageHandler
279279
{
280280
readonly ILogger<CustomAsyncNonCyclicMessageHandler> _logger;
281-
281+
282282
public CustomAsyncNonCyclicMessageHandler(ILogger<CustomAsyncNonCyclicMessageHandler> logger)
283283
{
284284
_logger = logger;
285285
}
286-
286+
287287
public async Task Handle(string message, string routingKey, IQueueService queueService)
288288
{
289289
_logger.LogInformation("You can do something async, e.g. send message back.");

docs/message-production.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static class Program
4545

4646
To publish a message to an exchange, use one of `IQueueService` sending methods.
4747

48-
You can send objects using `Send` or `SendAsync` methods. Objects will be serialized into json and sent with `IBasicProperties` where content type set as `"application/json"` and `Persistent` set as `true`.
48+
You can send objects using `Send` or `SendAsync` methods. Objects will be serialized into json and sent with `IBasicProperties` where content type set as `"application/json"` and `Persistent` set as `true`.
4949

5050
```c#
5151
var message = new

docs/rabbit-configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ public class Startup
1717
{
1818
services.AddRabbitMqClient(Configuration.GetSection("RabbitMq"));
1919
}
20-
20+
2121
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
2222
{
2323
}
2424
}
2525
```
2626

27-
The `AddRabbitMqClient` method will add an `IQueueService` as a **singleton**, but you can register it in the **transient** mode simply calling the `AddRabbitMqClientTransient` method which takes the same set of parameters.
27+
The `AddRabbitMqClient` method will add an `IQueueService` as a **singleton**, but you can register it in the **transient** mode simply calling the `AddRabbitMqClientTransient` method which takes the same set of parameters.
2828

2929
A RabbitMQ client can be configured via a configuration section located in the `appsettings.json` file. This configuration section must be of a certain format and down below is an example of all configuration options used in `IQueueService`.
3030

@@ -136,7 +136,7 @@ public class Startup
136136
};
137137
services.AddRabbitMqClient(configuration);
138138
}
139-
139+
140140
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
141141
{
142142
}

docs/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
These files cover all functionality of the library and if the new feature comes out documentation will have details of that.
44
Documentation consists of four sections. **RabbitMQ configuration section** covers ways of configuring the connection to the RabbitMQ host or multiple hosts (HA cluster).
55
**Exchange configuration section** explains the difference between consumption and production exchanges in terms of this library as well as specific nuances of configuring them.
6-
**Message production section** says about features of sending messages and **message consuming section** covers ways of receiving and handling messages.
6+
**Message production section** says about features of sending messages and **message consuming section** covers ways of receiving and handling messages.
77

88
## Table of contents
99

0 commit comments

Comments
 (0)