3 Replies Latest reply on Dec 25, 2007 9:48 AM by dklio

    not start MDB delivery automatically

    dklio

      Hi all!

      I've got an MDB that listens to a specific queue and performs further calls to business EJBs and MBeans. The problem is MBeans being called should be initialized by a system operator (human). Thus if there are messages in the queue while JBoss is starting, MDB will throw runtime exception because of some MBeans it calls are not initialized yet.

      The solution is simple. We are to prevent MDB from invoking while JBoss is starting and MBeans are initialized and enable invocation afterwards. It was accomplished rather easily with Standard Message Driven Bean. There were invoker-proxy-binding/proxy-factory-config/MDBConfig/DeliveryActive element in MDB deployment descriptor which being set to false disable MDB starting. Than, when everything is ready, we just call MDB's MBean startDelivery method and message handling is started.

      But unfortunately MQ provider for our system is IBM WebSphere MQ and we have to use WebSphere MQ Resource Adapter for enabling XA transactions. Hence we are forced to use Standard Message Inflow Driven Bean instead of Standard Message Driven Bean.

      I read jboss.dtd and JBoss sources and found that there is no such an option as DeliveryActive for message-inflow-driven-bean.

      Still we've got another option. Messages won't be consumed by MDB while MDB's MBean service is stopped. But to our regret MBean service for MDB is started automatically while JBoss is starting.

      Is there any legal way to delay message handling with MDB?

      Many thanks!