RabbitMQ com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error
<p>I am using rabbitmq as a broker, to dispatch the request and response between my different applications. While i am facing a weird behavior from the rabbitmq. It gives me this exception after processing 2500 to 3000 records. </p>

<blockquote>
  <p>com.rabbitmq.client.AlreadyClosedException: connection is already
  closed due to connection error; cause: java.net.SocketException:
  Connection reset  at
  com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:195)
  ~[amqp-client-3.5.6.jar:na]   at
  com.rabbitmq.client.impl.AMQChannel.transmit(AMQChannel.java:309)
  ~[amqp-client-3.5.6.jar:na]</p>
</blockquote>

<p>One more thing when i tried to run it my client with <strong>2 second delay</strong> between the messages, this issue did occur. This is the code i am trying to publish the message.</p>

<pre><code>     try {
          byte[] e = jsonMessage.getBytes(RabbitConf.COMMUNICATION_ENCODING);
          this.channel.basicPublish(exchangeType.name(), rountingKey.name(), (BasicProperties)null, e);
      } catch (IOException var6) {
          this.LOG.error("IOException when sending data to rabbit:", var6);
       }
</code></pre>

<p>I am using amqp-client 3.6.0 for my client. 
Any suggestion will be welcome.</p>