Skip to content

Commit

Permalink
added default publisher confirmation timeout to the corresponding pub…
Browse files Browse the repository at this point in the history
…lisher strategy
  • Loading branch information
tarurar committed Nov 6, 2020
1 parent b341b40 commit d907c28
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Lykke.RabbitMqBroker.Publisher
public sealed class FanoutPublishStrategyWithConfirmations : IRabbitMqPublishStrategy
{
private readonly bool _durable;
private readonly TimeSpan _defaultConfirmationTimeout = TimeSpan.FromSeconds(5);

public FanoutPublishStrategyWithConfirmations(RabbitMqSubscriptionSettings settings)
{
Expand All @@ -32,7 +33,7 @@ public void Publish(RabbitMqSubscriptionSettings settings, IModel channel, RawMe
routingKey: string.Empty,
basicProperties: null,
body: message.Body);
channel.WaitForConfirmsOrDie(settings.PublisherConfirmationTimeout);
channel.WaitForConfirmsOrDie(settings.PublisherConfirmationTimeout ?? _defaultConfirmationTimeout);
}
}
}

0 comments on commit d907c28

Please sign in to comment.