You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 29, 2022. It is now read-only.
Wrapper-library of RabbitMQ.Client with Dependency Injection infrastructure under the .Net Core 2.2 platform.
6
6
7
-
###Producer
7
+
## Producer
8
8
9
9
First of all you have to add all service dependencies in the `ConfigureServices` method. `AddRabbitMqClient` adds `IQueueService` that can send messages and `AddExchange` configures and adds an exchange. You can add multiple exchanges but the queue service will be single (and it will be added as singleton obviously).
10
10
@@ -75,7 +75,7 @@ queueService.Send(
75
75
In order to make this possible, a default dead-letter-exchange with `"default.dlx.exchange"` name will be created. You can change it via main exchange configuration (example is down below).
76
76
And also you have a default functionality of resending failed messages (if you get an error while processing recieved message).
77
77
78
-
###Consumer
78
+
## Consumer
79
79
80
80
Lets imagine that you wanna make a consumer as a console application. Then code will look like this:
You can find example projects in the repository too.
207
207
208
-
###appsettings.json configuration
208
+
## appsettings.json configuration
209
209
210
210
You have to add a couple configuration sections: (1) settings to connect to the RabbitMQ server and (2) a section that configures an exchange (one section per exchange frankly speaking).
211
211
Exchange sections define how to bind queues and exchanges with each ohter and which routing keys to use for that.
212
212
You can bind a queue to an exchange with more than one routing key, but if there are no routing keys in the queue section, then that queue will be bound to the exchange with its name.
213
-
```
213
+
```json
214
214
{
215
215
"RabbitMq": {
216
216
"HostName": "127.0.0.1",
@@ -235,7 +235,7 @@ You can find example projects in the repository too.
235
235
```
236
236
237
237
`Type`, `Durable`, `AutoDelete`, `DeadLetterExchange`, `RequeueFailedMessages` are set with default values in this example. So you can change it or leave it like this:
0 commit comments