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/message-consumption.md
+107-5Lines changed: 107 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,113 @@
1
1
# Message consumption
2
2
3
+
### Starting a consumer
4
+
5
+
The first step that needs to be done to retrieve messages from queues is to start a consumer. This can be achieved by calling `StartConsuming` method of `IQueueService`.
6
+
Without calling `StartConsuming` consumption exchanges will work only in production mode.
To retrieve messages from queues you have to configure services that will handle received messages.
109
+
The second step without which receiving messages does not make sense - configuration of message handling services. If there are no message handlers then received messages will not be processed.
110
+
6
111
Message handlers are classes that implement `IMessageHandler` interface (or a few others) and contain functionality including error handling for processing messages.
7
112
You can register `IMessageHandler` in your `Startup` like this.
The RabbitMQ client configuration and exchange configuration sections not specified in this example, but covered [here](rabbit-configuration.md) and [here](exchange-configuration.md).
34
136
35
137
`IMessageHandler` implementation will "listen" for messages by specified routing key, or a collection of routing keys.
0 commit comments