I don't understand the flow here. Is your JMS listener consuming messages and then attempting to insert them into a database using the invalid Hibernate session? If so, why don't you just rollback the session if the Hibernate operation fails and set a redelivery delay on the messages?
Justin ----- Original Message ----- From: "rsahadevan" <priyavira...@gmail.com> To: users@activemq.apache.org Sent: Friday, June 2, 2017 12:11:32 PM Subject: Re: ActiveMQ Embedded with Tomcat missing messages while restart HI All, Identified the issue. JMS Listener fires before Hibernate is setup on Server startup. Could you some one help on below points 1) How I can delay jms:listener-container for 3 minutes to start. This will solve the issue. By the time hibernate session will be ready. <jms:listener-container connection-factory="jmsConnectionFactory" transaction-manager="transactionManager" acknowledge="transacted"> <jms:listener ref="processBalanaceMDB" destination="queue.jbilling.balance"/> <jms:listener ref="processPaymentMDB" destination="queue.jbilling.processors"/> <jms:listener ref="notificationMDB" destination="queue.jbilling.notifications"/> </jms:listener-container> -- View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Embedded-with-Tomcat-missing-messages-while-restart-tp4726828p4726958.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.