1 Reply Latest reply on Mar 19, 2004 1:35 PM by joebarh

    retry delay for MDB

    ebdon

      Is there any way to configure a delay between retries of a transactional Message Driven Bean? For our application, we want to retry on a resource failure (such as a database being down), but don't want the retry to be immediate (maybe retry every 5 minutes). Right now we have some code to queue these to a scheduled MBean, which then runs every 5 minutes, and requeues it back to the MDB pool. I would really like to eliminate this code if possible in favor of a single config parameter, or if not, at least simply a reasonable amount of XML config.

      Thanks!

        • 1. Re: retry delay for MDB
          joebarh

          With JBoss 3.2.3, there is a JBoss-specific property that you can set on the message prior to publication

          here is an example

          cat.info("Creating a TextMessage ...");
          TextMessage outMessage= topicSession.createTextMessage(outString);
          outMessage.setStringProperty( "modifiedDate", modifiedDate );

          //JBoss specific property to delay retry after failure to publish
          outMessage.setLongProperty("JMS_JBOSS_REDELIVERY_DELAY", 10000);

          cat.info("Publish the message to: " + topic.getTopicName());
          topicPublisher.publish(outMessage);

          the delay is in milliseconds.

          Good luck

          Joe