From 1600b1210e07d5ee35f9c26f4fdbab303c8d7474 Mon Sep 17 00:00:00 2001
From: fraliv13 <5892139+fraliv13@users.noreply.github.com>
Date: Tue, 11 Feb 2020 14:24:40 +0200
Subject: [PATCH] Configurable AckWait setting for NATS message redelivery
(#62)
---
.../NBB.Messaging.Nats.csproj | 65 ++++++++++---------
.../NatsMessagingTopicSubscriber.cs | 2 +-
2 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj b/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj
index 2897e138..eb9e5b7a 100644
--- a/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj
+++ b/src/Messaging/NBB.Messaging.Nats/NBB.Messaging.Nats.csproj
@@ -1,32 +1,33 @@
-
-
-
- SAK
- SAK
- SAK
- SAK
-
-
-
- netstandard2.0
- Nats messaging
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ SAK
+ SAK
+ SAK
+ SAK
+
+
+
+ netstandard2.0
+ Nats messaging
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Messaging/NBB.Messaging.Nats/NatsMessagingTopicSubscriber.cs b/src/Messaging/NBB.Messaging.Nats/NatsMessagingTopicSubscriber.cs
index a7cc633f..198d7eb6 100644
--- a/src/Messaging/NBB.Messaging.Nats/NatsMessagingTopicSubscriber.cs
+++ b/src/Messaging/NBB.Messaging.Nats/NatsMessagingTopicSubscriber.cs
@@ -57,7 +57,7 @@ private Task SubscribeToTopicAsync(string subject, Func handler, C
//https://github.com/nats-io/go-nats-streaming#subscriber-rate-limiting
opts.MaxInflight = 1;
- opts.AckWait = 50000;
+ opts.AckWait = _configuration.GetSection("Messaging").GetSection("Nats").GetValue("ackWait") ?? 50000;
void StanMsgHandler(object obj, StanMsgHandlerArgs args)
{