Closed antonyvorontsov closed 4 years ago
I have done it here https://github.com/AntonyVorontsov/RabbitMQ.Client.Core.DependencyInjection/pull/24
So now message handlers can be registered with the given order like this
services.AddRabbitMqClient(clientConfiguration)
.AddExchange("ExchangeName", isConsuming: true, exchangeConfiguration)
.AddMessageHandlerSingleton<CustomMessageHandler>("first.routing.key", order: 20)
.AddMessageHandlerSingleton<OtherCustomMessageHandler>("first.routing.key", order: 10)
Higher order means that higher importance of message handler. That means that in the given example CustomMessageHandler
will handle received message first and the OtherCustomMessageHandler
will be second.
Complete coverage of that feature will be added to the documentation file ASAP. The release version of the library that contains explained feature - v3.1.2
Add order for each
MessageHandler
in case if a client want to sub more than 1 message handler for one routing key (in other words when one message being processed by multiple message handlers).