1 Reply Latest reply on Jan 2, 2003 4:38 PM by tallpsmith

    Only one instance of a Message Driven Bean?

    raphael

      Hi,

      I have a message driven bean which must only be instantiated
      once by JBoss. The reason is that the business functionality requires that the messages are kept in the original sequence.

      Now I found in the JBoss book (vers. 3.0.4) page 166 that
      there is a configuration in standardjboss.xml in the section
      org.jboss.ejb.plugins.MessageDrivenInstancePool
      where I can configure the MaximumSize to 1 and
      set strictMaximumSize to true.

      That will configure JBoss to let *ALL* MDBs be singletons!

      It seems to me that this is a bad idea. I would prefer a
      solution where I can configure this for one specific MDB
      rather than for all MDBs.

      Is this possible?
      Can it even be configured in the MDB's deployment descriptor?

      Thanks in advance!

      Raphael

        • 1. Re: Only one instance of a Message Driven Bean?
          tallpsmith

          Hi,

          After scrounging around the forums myself about this topic yesterday I found a method that works (but with a caveat). The JMS spec, apparantly, does not require that the message be delivered sequentially. Why? I dunno, particularly for a Queue (unless I miss read previous posts and this is only applicable to publish subscribe).

          Anyway, here's my jboss.xml for the MDB test that I did that worked for me, it basically defines a specific configuration for that bean:


          <enterprise-beans>
          <message-driven>
          <ejb-name>SimpleHelloWorldConsumer</ejb-name>
          <destination-jndi-name>queue/A</destination-jndi-name>
          <configuration-name>MySingletonConfig</configuration-name>
          </message-driven>
          </enterprise-beans>

          <container-configurations>
          <container-configuration extends="Standard Message Driven Bean">
          <container-name>MySingletonConfig</container-name>
          <container-invoker-conf>
          DefaultJMSProvider
          StdJMSPool
          1
          1

          10

          queue/DLQ
          10
          0


          </container-invoker-conf>
          <container-pool-conf>
          1
          1
          true
          </container-pool-conf>
          </container-configuration>
          </container-configurations>




          cheers,

          Paul Smith