title: WebSphere MQ and Atomikos - Messages Lost on process termination
body: <p>My app (a spring message listener) reads from a queue and writes to the database in a single transaction. I use Atomikos to provide the XA transaction behaviour. When the app is abruptly terminated with kill statements for example, I see messages are lost. Is there any specific configuration I need to use? Should the queues be persistent? Currently the queues are non-persistent. My MQ version is v7.1. </p>
  
  <p>Spring config for listener container looks like:</p>
  
  <pre><code>&lt;bean id="listenerContainer" class="com.miax.test.TestListenerMDPImpl" autowire="byName"&gt;
      &lt;property name="connectionFactory" ref="mqConnFactory" /&gt;
      &lt;property name="destinationName" value="QUEUE" /&gt;
      &lt;property name="messageListener" ref="listenerAdapter" /&gt;
      &lt;property name="transactionManager" ref="jtaTransactionManager" /&gt;
      &lt;property name="sessionTransacted" value="true" /&gt;
      &lt;property name="concurrentConsumers" value="1" /&gt;
      &lt;!-- receive time out, should be less than tranaction time out --&gt;
      &lt;property name="receiveTimeout" value="3000" /&gt;
      &lt;!-- retry connection every 1 seconds --&gt;
      &lt;property name="recoveryInterval" value="1000" /&gt;
      &lt;property name="autoStartup" value="true" /&gt;
      &lt;property name="sessionAcknowledgeMode" value="0" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Any other info will be given as needed.</p>
  
  <p>Thanks.</p>