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/changelog.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,15 @@
2
2
3
3
All notable changes to this library will be documented in this file.
4
4
5
-
## [4.3.0] - Will be drafted
5
+
## [4.3.0] - 2020-10-03
6
+
7
+
### Added
8
+
9
+
-`BasicDeliverEventArgs` extensions for parsing messages.
6
10
7
11
### Changed
8
12
13
+
-**Breaking!**`IMessageHandler`, `IAsyncMessageHandler`, `INonCyclicMessageHandler` and `IAsyncNonCyclicMessageHandler` get messages in `Handle` methods as `BasicDeliverEventArgs` instead of string values.
9
14
-**Breaking!**`BatchMessageHandler` has been removed, `BaseBatchMessageHandler` is now one and only base class for handling messages in batches. `HandleMessages` method of `BaseBatchMessageHandler` gets a collection of messages as `BasicDeliverEventArgs` instead of bytes.
Copy file name to clipboardExpand all lines: docs/message-consumption.md
+36-11Lines changed: 36 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,16 +109,16 @@ The second step is to define classes that will take responsibility of handling r
109
109
110
110
### Synchronous message handlers
111
111
112
-
`IMessageHandler` consists of one method `Handle` that gets a message in a string format. You can deserialize that message (if it is a json message) or handle its raw value.
112
+
`IMessageHandler` consists of one method `Handle` that gets a message. You can deserialize that message with `BasicDeliverEventArgs` extensions (described below).
The message handling process organized as follows:
307
307
308
308
-`IQueueMessage` receives a message and delegates it to `IMessageHandlingService`.
309
-
-`IMessageHandlingService` gets a message (as a byte array) and decodes it to the UTF8 string. It also checks if there are any message handlers in a combined collection of `IMessageHandler`, `IAsyncMessageHandler`, `INonCyclicMessageHandler` and `IAsyncNonCyclicMessageHandler` instances and forwards a message to them.
309
+
-`IMessageHandlingService` gets a message and checks if there are any message handlers in a combined collection of `IMessageHandler`, `IAsyncMessageHandler`, `INonCyclicMessageHandler` and `IAsyncNonCyclicMessageHandler` instances and forwards a message to them.
310
310
- All subscribed message handlers (`IMessageHandler`, `IAsyncMessageHandler`, `INonCyclicMessageHandler`, `IAsyncNonCyclicMessageHandler`) process the given message in a given or a default order.
311
311
-`IMessageHandlingService` acknowledges the message by its `DeliveryTag`.
312
312
- If any exception occurs `IMessageHandlingService` acknowledges the message anyway and checks if the message has to be re-send. If exchange option `RequeueFailedMessages` is set `true` then `IMessageHandlingService` adds a header `"re-queue-attempts"` to the message and sends it again with delay in value of `RequeueTimeoutMilliseconds` (default is 200 milliseconds). The number of attempts is configurable and re-delivery will be made that many times as the value of `RequeueAttempts` property. Mechanism of sending delayed messages covered in the message production [documentation](message-production.md).
The message handler will create a separate connection and use it for reading messages.
361
361
When the message collection is full to the size of `PrefetchCount` it will be passed to the `HandleMessage` method.
362
362
363
+
### Parsing extensions
364
+
365
+
There are some simple extensions for `BasicDeliverEventArgs` class that helps to parse messages. You have to use `RabbitMQ.Client.Core.DependencyInjection` namespace to enable those extensions.
366
+
There is an example of using those extensions inside a `Handle` method of `IMessageHandler`.
You can also pass `JsonSerializerSettings` to `GetPayload` or `GetAnonymousPayload` methods as well as collection of `JsonConverter` in case you use custom serialization.
387
+
363
388
For message production features see the [Previous page](message-production.md)
364
389
365
390
For more information about advanced usage of the RabbitMQ client see the [Next page](advanced-usage.md)
0 commit comments