activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: QueueBrowser not picking all the messages
Date Mon, 28 Jan 2013 22:01:40 GMT
The general downside is using up too much broker memory when there are no
consumers for a particular queue (or slow consumers)


On Mon, Jan 28, 2013 at 2:12 PM, Mohit Anchlia <mohitanchlia@gmail.com>wrote:

> Is there a downside of increasing to a much higher value?
>
> On Mon, Jan 28, 2013 at 1:05 PM, Christian Posta
> <christian.posta@gmail.com>wrote:
>
> > Can set the max page size using policy entries:
> >
> > http://activemq.apache.org/per-destination-policies.html
> >
> >
> > On Mon, Jan 28, 2013 at 1:15 PM, Mohit Anchlia <mohitanchlia@gmail.com
> > >wrote:
> >
> > > Thanks! It does look related. How can I verify the page size? And is
> > there
> > > a workaround?
> > >
> > > On Mon, Jan 28, 2013 at 12:10 PM, Gary Tully <gary.tully@gmail.com>
> > wrote:
> > >
> > > > there was a recent fix
> https://issues.apache.org/jira/browse/AMQ-4181
> > > >
> > > >
> > > > On 28 January 2013 17:42, Mohit Anchlia <mohitanchlia@gmail.com>
> > wrote:
> > > >
> > > > > Thanks for testing. Is there anything related to pre-fetch or some
> > > other
> > > > > property that might cause it to return no elements even though
> there
> > > are
> > > > > elements in the queue?
> > > > >
> > > > > On Mon, Jan 28, 2013 at 6:25 AM, Christian Posta
> > > > > <christian.posta@gmail.com>wrote:
> > > > >
> > > > > > Not sure. I just ran your test on trunk with 1000 messages and
it
> > > > picked
> > > > > it
> > > > > > up fine. I also added a test to JmsQueueBrowserTest unit test,
> > have a
> > > > > look
> > > > > > here:
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java?r1=1425875&r2=1439420&diff_format=h
> > > > > >
> > > > > >
> > > > > > On Fri, Jan 25, 2013 at 1:08 PM, Mohit Anchlia <
> > > mohitanchlia@gmail.com
> > > > > > >wrote:
> > > > > >
> > > > > > > Does anyone know why queue browser is only able to pick
up
> first
> > > 300
> > > > > > > messages?
> > > > > > >
> > > > > > > When I use consumer it seems to work better but of course
it
> also
> > > > > removes
> > > > > > > the messages.
> > > > > > >
> > > > > > > On Thu, Jan 24, 2013 at 5:47 PM, Mohit Anchlia <
> > > > mohitanchlia@gmail.com
> > > > > > > >wrote:
> > > > > > >
> > > > > > > > I have around 1K messages in the queue. When I run
my queue
> > > browser
> > > > > > > > "browser.getEnumeration();" gets only 270-300 messages
at one
> > > time.
> > > > > > > >
> > > > > > > >    connection = connectionFactory.createConnection();
> > > > > > > >    connection.start();
> > > > > > > >    session = connection.createSession(false,
> > > > > Session.AUTO_ACKNOWLEDGE);
> > > > > > > >    Queue fq = session.createQueue(from);
> > > > > > > >    QueueBrowser browser = session.createBrowser(fq);
> > > > > > > >    // to
> > > > > > > >    toConnection = toConnectionFactory.createConnection();
> > > > > > > >    toConnection.start();
> > > > > > > >    toSession = toConnection.createSession(false,
> > > > > > > >      Session.AUTO_ACKNOWLEDGE);
> > > > > > > >    Queue tq = toSession.createQueue(to);
> > > > > > > >    toProducer = toSession.createProducer(tq);
> > > > > > > >    Enumeration<Message> e = browser.getEnumeration();
> > > > > > > >    Message message = null;
> > > > > > > >    TextMessage textMessage = null;
> > > > > > > >    String selector = null;
> > > > > > > >    int i = 0;
> > > > > > > >    while (e.hasMoreElements()) {
> > > > > > > >     log.info("Processing " + i);
> > > > > > > >
> > > > > > > >     message = e.nextElement();
> > > > > > > >     // final String messageBody = ((TextMessage)
> > > > message).getText();
> > > > > > > >     // textMessage = session.createTextMessage(messageBody);
> > > > > > > >     toProducer.send(message);
> > > > > > > >     log.info(message.getJMSMessageID());
> > > > > > > >     /*
> > > > > > > >      * // log.info("Message: " + messageBody); try
{
> selector
> > =
> > > > > > > >      * "JMSMessageID = '" + message.getJMSMessageID()
+ "'";
> //
> > > > > > > >      * consumer = session.createConsumer(fq, selector);
//
> > > > > > > >      * consumer.receive(); } finally { // consumer.close();
}
> > > > > > > >      */
> > > > > > > >     i++;
> > > > > > > >    }
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > *Christian Posta*
> > > > > > http://www.christianposta.com/blog
> > > > > > twitter: @christianposta
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > http://redhat.com
> > > > http://blog.garytully.com
> > > >
> > >
> >
> >
> >
> > --
> > *Christian Posta*
> > http://www.christianposta.com/blog
> > twitter: @christianposta
> >
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message