title: How does one make activemq actually reliable? When brokers disconnect messages are lost
body: <p>We have a JEE6 app built in Apache TomEE v1.6.0+. There are two parts, a cloud part, and a ground part. The cloud part is intended to be never restarted, since it monitors a transient source of information, but creates JMS messages and sends them to it's broker.</p>
  
  <p>The ground part is intended to be restart-able during the day and is where the complex processing logic is. It too has a broker which connects to the cloud broker.</p>
  
  <p>The problem we are having is that if we take down the ground instance of TomEE for more than a few mins, then start it up again, the cloud broker will not deliver all the messages that stacked up. Furthermore, it doesn't deliver any new messages either, forcing us to restart it, which makes us lose our messages.</p>
  
  <p>Here are the two connection URIs... What on earth are we doing wrong??</p>
  
  <p>Cloud:</p>
  
  <pre><code>&lt;Resource
      id="ActiveMQResourceAdapter"
      type="ActiveMQResourceAdapter"&gt;
      BrokerXmlConfig = broker:(ssl://0.0.0.0:61617?needClientAuth=true&amp;amp;transport.keepAlive=true&amp;amp;transport.soTimeout=30000,vm://localhost,network:static:(failover:(ssl://ground.somedomain.com:61617?keepAlive=true&amp;amp;soTimeout=30000)))?persistent=true
      ServerUrl = vm://localhost
      DataSource = jdbc/activemq
  &lt;/Resource&gt;
  </code></pre>
  
  <p>Ground:</p>
  
  <pre><code>&lt;Resource
      id="ActiveMQResourceAdapter"
      type="ActiveMQResourceAdapter"&gt;
      BrokerXmlConfig = broker:(ssl://0.0.0.0:61617?needClientAuth=true&amp;amp;transport.keepAlive=true&amp;amp;transport.soTimeout=30000,vm://localhost,network:static:(failover:(ssl://cloud.somedomain.com:61617?keepAlive=true&amp;amp;soTimeout=30000)))?persistent=true
      ServerUrl = vm://localhost
      DataSource = jdbc/activemq
  &lt;/Resource&gt;
  </code></pre>
  
  <p>Any help is much appreciated. Thank you very much!!</p>