2 Replies Latest reply on Dec 1, 2003 1:15 PM by Elias Ross

    MDB onMessage()  timeout / multiple MDB Instances

    stscit04 Newbie


      I try to implement a notification server that
      receives Messages on a Queue and sends out
      Notifications over HTTP with SOAP.

      The behaviour should be that notificaitons that cant be
      delivered the first time should be resend after 10-20 seconds.

      My first thought was to write a MBD that waits in its onMessage method for the 10-20 seconds then retrys.

      The questions are:
      - Do I have to worry about some sort of timeout in the
      onMessage method ?
      - Are there multiple instances of my MDB working or
      will waiting in the onMessage method block the
      prcessing of all messages in the queue ?

      Mybe there is a complete different aproach to solve my problem, any suggestions on this are alway welcome.

      Thanks in advance


        • 1. Re: MDB onMessage()  timeout / multiple MDB Instances
          Adrian Brock Master

          There are 15 concurrent sessions by default, see standardjboss.xml
          Waiting 10-20 seconds will just block one of these.

          From jboss-3.2.2 you can do scheduled redelivery when
          you send the message.
          But this won't help you much since all that will happen is
          the next message in the queue will fail.

          You really need to do some system level processing
          for this. Where once you detect a failure you suspend
          delivery of the mdb and go on a retry loop waiting for
          your destination to come back.


          • 2. Re: MDB onMessage()  timeout / multiple MDB Instances
            Elias Ross Master

            There is a container transcation timeout of 5 (?) minutes set by the transaction manager. Thus, you shouldn't be inside the onMessage() method for more than 5 minutes. This can be increased. I think what happens if you go over the time limit is that the container will attempt to roll back the transaction. If you have already posted your SOAP message, then you will probably send another as JBoss will redeliver the JMS message.