4 Replies Latest reply on Jun 8, 2008 4:05 AM by timfox

    Does SlowConsumers flag work correctly?

    szhigunov

      Hi,

      I want to turn off message buffering, so I set SlowConsumers=true on my connection factory.
      But it looks like one message gets prefetched anyway.

      Here is my test:
      1) There are 10 messages on the queue.
      2) Session is opened.
      3) Queue MBean shows MessageCount=10, DeliveringCount=0.
      3) Consumer created.
      4) Queue MBean shows MessageCount=10, DeliveringCount=1.
      5) Receive executed.
      4) Queue MBean shows MessageCount=10, DeliveringCount=2.
      5) Session closed.
      4) Queue MBean shows MessageCount=9, DeliveringCount=0.

      Is that the expected behavior?
      Is there any way to turn prefetch completely, so all messages which are not received would be visible to all consumers?

      I am running JBoss 4.2.2 + JBM 1.4.0.SP3


        • 1. Re: Does SlowConsumers flag work correctly?
          schmidp

           

          Is there any way to turn prefetch completely, so all messages which are not received would be visible to all consumers?


          We have the same requirement, so I'm interested in an answer as well :-)

          Best regards,

          Philipp Schmid

          • 2. Re: Does SlowConsumers flag work correctly?
            ataylor

            Setting slow consumers=true has the effect of setting the prefetch size to 1. This means that the server will only deliver 1 message the client side buffer. Once the client has consumed this message and the buffer is empty the client notifies the server and it starts redelivering.

            • 3. Re: Does SlowConsumers flag work correctly?
              szhigunov

              In my scenario I always consume one big message per session (in its own XA transaction). So the behavior described above (PrefetchSize=1) seems like unnecessary overhead: I want to consume one message; I download two to the client, use one; release the other.

              Is there the way to tell the system I need just one at a time?

              If not, is that a big overhead?

              Does JBM eagerly downloads the entire message (say 10 Megabytes) or just handler, so the rest of the body gets downloaded on demand (when the application actually starts reading)?

              • 4. Re: Does SlowConsumers flag work correctly?
                timfox

                 

                "szhigunov" wrote:

                Is there the way to tell the system I need just one at a time?



                Not for JBM 1.x.

                In JBM 2.0 it allows the behaviour you expect, but that won't be ready for production for some time.