RabbitMQ.Client.Core.DependencyInjection
RabbitMQ.Client.Core.DependencyInjection copied to clipboard
Upcoming changes
I have struggled to find free time to develop this project due to my busy schedule and it looked like this library is frozen, but now I am going to get back to the active stage of development. This issue is representation of my plans on version 5.0.0 and upcoming ones which imply breaking changes to the current paradigm of how the library works. So I want to share my plans to anyone who is interested.
version 5.0.0
- Remove
IQueueServiceinterface and split the service into two parts ✔️ - Add
IConsumingServiceand its implementation ✔️ - Add HostedService that will run
StartConsumingmethod ✔️ - Add HostedService that will be responsible for declaring queues and exchanges ✔️
- Remove queues and exchanges declaration from the constructor of consuming and producing services ✔️
- Remove
IAsyncNonCyclicMessageHandlerandINonCyclicMessageHandlerdue to their redundancy ✔️ - Remove
IAsyncNonCyclicMessageHandlerandINonCyclicMessageHandlerdependency injection extensions ✔️ - Add extension methods that will allow to register components flexibly (e.g. start consuming in your own component) ❌ (next update)
- Add new option that will allow to disable logging for those who do now want to get default log messages ✔️
- Update documentation (obviously)
- Annotate everything with nullable reference types ✔️
- Update examples
If you want to request some functionality feel free to do it.
This issue will be updated with additional information.
what is the replacement from IQueueService in term of sending message?
This one https://github.com/AntonyVorontsov/RabbitMQ.Client.Core.DependencyInjection/blob/master/src/RabbitMQ.Client.Core.DependencyInjection/Services/Interfaces/IProducingService.cs
Are there plans to implement publish confirms? https://www.rabbitmq.com/confirms.html#publisher-confirms
If we want two different microservices to handle the same event, we need to have two different queues
Currently, I define queues in the following way:
new RabbitMqExchangeOptions()
{
Type = "direct",
DeadLetterExchange = "exchange.dlx",
RequeueAttempts = 4,
RequeueTimeoutMilliseconds = 50,
Queues = new List<RabbitMqQueueOptions>
{
new()
{
Name = $"{QueuePrefix}-{UserStatusChangedRoutingKey}",
RoutingKeys = new HashSet<string> { UserStatusChangedRoutingKey }
},
}
})
But it would be handy if we only provide queue name and this library automatically creates queue with name which consist of QueuePrefix from configuration(will need to add to config) + queue name supplied by a user
@AntonyVorontsov What do you think?