3 Replies Latest reply on Sep 5, 2002 10:45 AM by Simon Hargreaves

    "rollback" a Message during onMessage()

    Wolf-Dieter Fink Master

      Hi,

      I have a problem to get a Message twice if error occur.

      My idea:
      If a problem occurs in onMessage() the Message should be delivered again.

      My Code:

      QueueConnectionFactory conF = (QueueConnectionFactory).lookup("QueueConnectionFactory");
      con = conF.createQueueConnection();
      session=con.createQueueSession(false,acknowledge);
      //Test with acknowledge DUPS_OK_ || CLIENT_ || AUTO_
      . . .

      onMessage(message) {
      try {
      if(!error) {
      message.acknowledge();
      }
      }catch(Exception e) {
      //Error . . .
      }
      }


      After onMessage() runs the Message is never delivered again, I think it's marked as 'delivered' in JBoss-Queue.

      What is wrong with my idea :-( or Code?

      Thanks
      Wolf