'JMSCC0008: This connection is closed while calling JMSTemplate.send method

I am facing an intermittent issue in an application where we used to connect to IBM MQ and we have two queues one for sending the reply and another one is to listen message from MQ ,listening message seems not having any issue but while sending the reply it seems the connection gets closed sometimes and thus resulting in below error in logs

 JMSCC0008: This connection is closed.; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0008: This connection is closed.
An application called a method that must not be used after the connection is closed.
Ensure that the connection is not closed before calling the method.
org.springframework.jms.IllegalStateException: JMSCC0008: This connection is closed.; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0008: This connection is closed.
An application called a method that must not be used after the connection is closed.
Ensure that the connection is not closed before calling the method.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source