I added
Code:
<property name="sessionTransacted" value="true" />
<property name="sessionAcknowledgeMode">
<value>2</value>
</property>
to the jmsTemplate and DefaultMessageListenerContainer bean
further more I added
Code:
<property name="messageConverter">
<null/>
</property>
to the messageListener so that we get the Raw message in the receiver class
and finally the receive method was changed to
Code:
TransactionStatus txnStatus = jmsTransactionManager.getTransaction(new DefaultTransactionDefinition());
MyMsgIfc myMsg = (MyMsgIfc) objMsg.getObject();
handleMsg(myMsg );
// Acknowledge only if everything went fine.
objMsg.acknowledge();
jmsTransactionManager.commit(txnStatus);
Now stuff works as it should..
The next challenge is to handle poisson messages.