Version 6

    Each JBoss Messaging consumer, by default buffers a list of messages from the queue or subscription it is consuming from, before they are actually consumed by the end user. This is done for performance reasons to avoid having to make a call from client->server every time a message is required which would give very poor performance.

     

    I.e. message on server --> client side buffer --> client (via return from a receive() or onMessage of a message listener).

     

    By default, a maximum of 150 messages are buffered (prefetched) per consumer. This is governed by the prefetchSize parameter on the connection factory.

     

    Any messages that are buffered are no longer in the queue, and consequently you won't be able to see them when browsing or using any JMX operations that involve listing or calculations on the messages in the queue.

     

    Also if you have many consumers on a queue, you may find that some consumers have buffered all the messages making them unavailable to other consumers. This would normally only be an issue if your consumers are slow, in which case you can reduce the value of prefetchSize or turn off buffering altogether by setting the SlowConsumers attribute on the connection factory to true

     

    If the consumer is closed without consuming all the messages in its buffer or it crashes, the messages are automatically cancelled back to the queue so they can be consumed by other consumers.

     

    See the user guide for more details of how to set the PrefetchSize and SlowConsumers attributes.