What's Changed
- add CODEOWNERS by @bmoriniere in #37
- Update to .Net 6 by @harrich in #38
- BREAKING: Queues quorum helper implementation + tests update (update CI to .Net 8) by @OlivierLePichon in #41
New Contributors
- @harrich made their first contribution in #38
- @OlivierLePichon made their first contribution in #41
Full Changelog: v0.6.8...v0.7.0
BREAKING change details
To simplify the transition to quorum queues, this version adds a boolean isQuorum
where necessary (i.e., in all DeclareQueueXxx
methods).
For example, in IMessagingService
:
void DeclareQueue(string queueName, Dictionary<string, object> queueArgs, bool isQuorum)
Setting isQuorum
to true:
- Adds
["x-queue-type"]="quorum"
to the queueArgs. - Appends "-q" to the passed
queueName
.
The second point is necessary because it is not possible to recreate a queue with the same name without first destroying the previous one.
It was decided not to set a default value for isQuorum
to make this version a breaking change and force a choice.
When setting IsQuorum
to true, name given to the queue is now queueName + "-q"
. Since the queueName
provided as a parameter is no longer always the name given to the queue, the effectiveQueueName
(with effectiveQueueName = isQuorum ? queueName + "-q" : queueName
) is returned by all DeclareQueueXxx
methods.
This returned value should be used, for example, to declare bindings as done in:
private void CreateMainExchange(RetryStrategyConfiguration configuration, bool isQuorum)
{
_messagingService.DeclareExchange(configuration.BusName, Constants.ExchangeTypeTopic);
foreach (Channel channel in configuration.Channels)
{
var effectiveQueueName = _messagingService.DeclareQueue(channel.Value, isQuorum);
_messagingService.DeclareBinding(configuration.BusName, effectiveQueueName, $"{channel.Value}.#");
}
}
WARNING: Quorum queues must be durable and non-auto-delete. If isQuorum
is set to true in a DeclareQueueXxx
method for a queue that is not, you will get:
throw new ArgumentException("Quorum queues must be durable and non-auto-delete")