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.
Copy file name to clipboardExpand all lines: docs/rabbit-configuration.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@ public class Startup
24
24
}
25
25
```
26
26
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.
28
+
27
29
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`.
28
30
29
31
```json
@@ -141,4 +143,6 @@ public class Startup
141
143
}
142
144
```
143
145
146
+
There is also the `AddRabbitMqClientTransient` method which takes `RabbitMqClientOptions`.
147
+
144
148
For the exchange configuration see the [Next page](exchange-configuration.md)
Copy file name to clipboardExpand all lines: readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ public void ConfigureServices(IServiceCollection services)
26
26
}
27
27
```
28
28
29
-
By calling `AddRabbitMqClient` you add a singleton `IQueueService` that provides functionality of sending messages to queues. `AddProductionExchange` configures exchange to queues bindings (presented in json configuration) that allow messages to route properly.
29
+
By calling `AddRabbitMqClient` you add `IQueueService` that provides functionality of sending messages to queues. `AddProductionExchange` configures exchange to queues bindings (presented in json configuration) that allow messages to route properly.
30
30
Example of `appsettings.json` is two sections below. You can also configure everything manually. For more information, see [rabbit-configuration](./docs/rabbit-configuration.md) and [exchange-configuration](./docs/exchange-configuration.md) documentation files.
31
31
32
32
Now you can inject an instance of `IQueueService` inside anything you want.
0 commit comments