2 Replies Latest reply on Nov 11, 2011 3:12 AM by Tichomir Jabarski

    JMS transaction rollback on connection lost

    Tichomir Jabarski Newbie



      I have an EJB3-Service that sends a Message to a JMS-Queue and then commits the sending on the session. The Consumer is a remote Java client, that calls a C++ routine over JNI. So, when the client dies without to commit() or rollback() the transaction startet from the service, the messega has not been redelivered to the queue with the flag JMSRedelivered == true. I see that connection lost has been detected on the server and the resoruces has been released:


      2011-03-18 09:48:46,900 TRACE [org.jboss.jms.server.connectionmanager.SimpleConnectionManager] (Timer-2) ConnectionManager[18b329c] detected failure on client Client[24195539]
      2011-03-18 09:48:46,916 WARN  [org.jboss.jms.server.connectionmanager.SimpleConnectionManager] (Timer-2) A problem has been detected with the connection to remote client a1a3s5d-vd36os-gldy648o-1-gldy64i7-4, jmsClientID=b-4m46ydlg-1-o846ydlg-so63dv-d5s3a1a. It is possible the client has exited without closing its connection(s) or the network has failed. All associated connection resources will be cleaned up.
      2011-03-18 09:48:46,916 TRACE [org.jboss.jms.server.endpoint.ServerConnectionEndpoint] (Timer-2) ConnectionEndpoint[jc-4m46ydlg-1-y4mowdlg-jzmmkl-d5s3a1a] closing (noop)
      2011-03-18 09:48:46,916 TRACE [org.jboss.jms.server.endpoint.ServerConnectionEndpoint] (Timer-2) ConnectionEndpoint[jc-4m46ydlg-1-y4mowdlg-jzmmkl-d5s3a1a] close()
      2011-03-18 09:48:46,916 DEBUG [org.jboss.jms.server.connectionmanager.SimpleConnectionManager] (Timer-2) unregistered connection ConnectionEndpoint[jc-4m46ydlg-1-y4mowdlg-jzmmkl-d5s3a1a] with remoting session ID ...-gldy64i7-4


      Is there a way to rollback the transaction on "connection lost", in order to become the message the next time with the flag getJMSRedelivered() == true?