The problem you are facing appears beacuse of standard,  store based cursors
that works very well when  consumers are reading from the queue.  
In a few words when message comes to a queue  it is persisted in a store and
passed to a dispatch queue from which it is read by consumer. When consumer
is not fast enough or there is no consumer messages go straight to the
store. From that store they are read by cursor that buffers them. However
the number of messages that can be buffered is limited (by default is a 70%
of memory limit). 

Queue browser is actually reading only messages that are buffered by cursor.
That is why you can see only limited number of them. The rest of them is
sitting in the storage and waiting for the place in cursor. It can be
easilly tested. Add a number of messages to your queue so that not all of
them are viewed. Then from JConsole try to preview last message. It should
work. In the next step try to preview next message (its ID can be easily
calculated by a proper incrementation of a previous one). You will get null.
Then delete a message from the queue (it means you free some space in a
cursos) and try to retrieve message one more time you should get it then. 

What can be done to solve your problem is to use a different kind of cursor
/File Based Cursor/. With that cursor messages always go to both storage and
cursor. That one that are in the cursor are buffered on the disk that is why
unless you load them they don't consume memory. In order to switch on this
cursor just uncomment this in lines in policy for your queue:

/<pendingQueuePolicy>
                    <fileQueueCursor/>
</pendingQueuePolicy>/

However you have to remember that when you start to browse messages all of
them are loaded into memory. 

Detailed information about how cursor works can be found here:
http://activemq.apache.org/message-cursors.html
Here you can find destinatons policies parameters and their default values:
http://activemq.apache.org/per-destination-policies.html



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/QueueBrowser-does-not-return-large-messages-tp4656447p4659112.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to