Skip to content

v0.7.0

Latest
Compare
Choose a tag to compare
@OlivierLePichon OlivierLePichon released this 13 Feb 17:46
0ebf680

What's Changed

New Contributors

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:

  1. Adds ["x-queue-type"]="quorum" to the queueArgs.
  2. 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")