1 Reply Latest reply on Sep 8, 2001 10:57 PM by Hiram Chirino

    how and in what order JMS  dispatch messages to MDBs

    Rajesh Newbie

      Hi Jboss Gurus/Users,

      [SeetUp = OS; Win200 JBOSS : 2.2.2 JDK: 1.3]

      I have setup of two MDBs listening to two topics having pool configuration MDB1= 5, MDB2=10.
      I am sending same messages through multithreaded client to these topics. I am trying to measure performance of MDB to carry out certain business calculations (these two MDBs call same session bean for business calculations).

      But every time I run test I get different results. Sometimes MDB1 performs better than MDB2 even though pool size of MDB2 is larger. Ideally MDB2 should perform two times better than MDB1 due to pool size. I am not very clear about how JMS dispatches/allocates messages to these MDBs. I think JbossMQ is not forwarding messages in the order client sent. Is it a bug in Jboss?

      can ne one give some input about JMS working about arrival and dispatch of messages to MDBs.


        • 1. Re: how and in what order JMS  dispatch messages to MDBs
          Hiram Chirino Expert


          First off, if the MDB are not perfoming any blocking opperations (ie doing noops) then it would make sense that MDB1 would perform better as you have fewer context switches and therefore a lower overhead to process the messages.

          Now if your processing has a blocking operation like lets say Thread.sleep(100);, then MDB2 should perform better as it should be able to do more concurrent Thread.sleep() operations.

          And NO, the order of message delivery is not a bug!!!!
          That is the price you pay for having multiple concurrent threads sending messages to the MDB!
          The JMS Spec states that message order cannot be garanteed to a MDB. If you configure the pool to only 1 thread, you should get proper message order.