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()