From 04059362b3e04ca41b7246e568d916cb998583b5 Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Thu, 29 Feb 2024 08:38:40 -0500 Subject: [PATCH] Handle session thread (#3132) --- jms/src/main/scala/akka/stream/alpakka/jms/impl/Sessions.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jms/src/main/scala/akka/stream/alpakka/jms/impl/Sessions.scala b/jms/src/main/scala/akka/stream/alpakka/jms/impl/Sessions.scala index 3f08c97b01..56e4e7e097 100644 --- a/jms/src/main/scala/akka/stream/alpakka/jms/impl/Sessions.scala +++ b/jms/src/main/scala/akka/stream/alpakka/jms/impl/Sessions.scala @@ -97,7 +97,8 @@ private[jms] final class JmsAckSession(override val connection: jms.Connection, private def stopMessageListenerAndCloseSession(): Unit = { try { - drainAcks() + if (session.getAcknowledgeMode() == jms.Session.CLIENT_ACKNOWLEDGE) + drainAcks() } finally { ackQueue.put(Left(SessionClosed)) session.close()