3 Replies Latest reply on Apr 18, 2003 7:18 AM by Horia Muntean

    Message ordering

    Horia Muntean Newbie

      Hello ppl.

      Quoting from JMS spec (1.0.2b and 1.1) :
      --------------------------------------------------------------------- Order of Message Receipt
      JMS defines that messages sent by a session to a destinatin must be received in the order in which they were sent.(...) This defines a partial ordering constraint on a sessinon's input message stream.

      JMS does not define order of message receipt across destinations or across a destination's messages sent from multiple sessions. This aspect of a session's input message stream order it timing-dependent. It is not under application control.
      So I understand that the ordering of messages is guaranteed only under a producer's session. (Note the time dependent aspect too)

      I have a SLSB producer (called repeatedly, in the same thread, by a single remote client) which sends a message to a queue under TX control (java:/JmsXA factory) and a single consumer (an 1 pool MDB or a single JMS receiver). But the SLSB uses a session for each message, not one session for all messages (anyway this is impossible).

      Now the question: is there any way to guarantee in JBoss the message ordering from the remote client to the final consumer (supposing there are no rollbacks or application failures)? Because we have ONLY ONE SEQUENTIAL PRODUCER and ONLY ONE CONSUMER. Shouldn't sequentiality of the producer (TIME DEPENDENT) guarantee the message ordering (and is a queue afterall)?


      P.S. In JBoss-3.2.0., AFAIK there is no solution. I mean with the above scenario I get out of order messages.

        • 1. Re: Message ordering
          Adrian Brock Master

          Can you restate the problem or provide an
          I'm not sure I understand what your problem is.


          • 2. Re: Message ordering
            Horia Muntean Newbie

            Here is the layout:

            1. Client JVM
            2. GatewayBean (SLSB) running in JBoss JVM
            3. MessageBean (MDB) running in JBoss JVM

            1. The MDB container has only one bean instance.
            2. JBossMQ uses file PM.
            3. GatewayBean uses java:/JmsXA queue factory.

            1.ClientJVM -> GatewayBean.sendMessage() -> puts a message in a JBoss persistent queue (queueA).
            2. MessageBean consumes messages from queueA.
            The problem is that if the client sequentially (so giving a timebased order of the messages) invokes GatewayBean.sendMessage(), the MDB not always receives the messages in the same order.

            In one word, the message ordering is not conserved in this "one producer"->"one consumer" scenario. Which is somehow frustrating.


            • 3. Re: Message ordering - ups
              Horia Muntean Newbie

              My mistake. I am using JBoss-3.2.0 and I saw too late that conf. files have changed (I was using <container-configuration> in order to overwrite the pool size of the MDB container).

              Back to testing now with <invoker-bindings> conf. BTW, does 1 size bean pool guarantees really the message ordering? (I keep asking this 'cause I don't want to rely on probability). Should I even test this case?



              1.Does <invoker-proxy-binding> support "extends"? (like <container-configuration> - so one would not have to define the whole conf. in jbossx.ml).
              2. Any word about xdoclet support for those changes?