title: RabbitMQ subscriber timeout
body: <p>I have an issue when subscribing to RabbitMQ messages when traversing a CISCO ASA 5505 firewall. It appears there is some kind of timeout in the firewall which closes idle connections and results in my RabbitMQ subscription silently being dropped. The result is my subscriber doesn't throw/display any exception but doesn't receive published messages.</p>
  
  <pre><code>public class RabbitMqSubscriber&lt;T extends Serializable&gt; implements Subscriber&lt;T&gt; {
  
      private QueueingConsumer consumer;
      private MessageListener&lt;T&gt; listener;
      private String exchange;
      private String topic;
      public RabbitMqSubscriber(String host,String exchange,String topic) throws IOException {
          this.exchange=exchange;
          this.topic=topic;
          ConnectionFactory factory = new ConnectionFactory();
          factory.setHost(host);
              factory.setRequestedHeartbeat(10);
          Connection connection = factory.newConnection();
          Channel channel = connection.createChannel();
          channel.exchangeDeclare(exchange, "topic");
          String queueName = channel.queueDeclare().getQueue();
          channel.queueBind(queueName, exchange, topic);
          consumer = new QueueingConsumer(channel);
          channel.basicConsume(queueName, true, consumer);
      }
  
      public void run() {
  
          while (true) {
              QueueingConsumer.Delivery delivery;
              try {
                  delivery = consumer.nextDelivery();
                  Object o=SerializationUtils.deserialize(delivery.getBody());
                  listener.receive((T)o);
              } catch (ShutdownSignalException | ConsumerCancelledException | InterruptedException e) {
                  throw new RuntimeException(e);
              }
          }
      }
  
      @Override
      public void setListener(MessageListener&lt;T&gt; listener) {
          this.listener=listener;
      }
  
  }
  </code></pre>
  
  <p>I've also tried adding keepalive to the server config but this hasn't helped either:</p>
  
  <pre><code>[        {rabbit, [{tcp_listen_options, [binary, 
                       {packet, raw}, 
                       {reuseaddr, true}, 
                       {backlog, 128}, 
                       {nodelay, true}, 
                       {exit_on_close, false}, 
                       {keepalive, true}]}]}]. 
  </code></pre>