Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 22076 invoked from network); 21 Nov 2006 05:57:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2006 05:57:02 -0000 Received: (qmail 38097 invoked by uid 500); 21 Nov 2006 05:57:12 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 38030 invoked by uid 500); 21 Nov 2006 05:57:11 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 37975 invoked by uid 99); 21 Nov 2006 05:57:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Nov 2006 21:57:11 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Nov 2006 21:56:57 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GmOcW-0002yA-Go for activemq-users@geronimo.apache.org; Mon, 20 Nov 2006 21:56:36 -0800 Message-ID: <7466254.post@talk.nabble.com> Date: Mon, 20 Nov 2006 21:56:36 -0800 (PST) From: Priya Parvatikar To: activemq-users@geronimo.apache.org Subject: QueueBrowser in embedded broker not getting any messages MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: priya.parvatikar@ingenta.com X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am trying to use a QueueBrowser to browse messages sent using an embedded broker. I am using ActiveMQ version 4.0.2. The broker is set up using new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); However the QueueBrowser doesn't appear to get any messages i.e. browser.getEnumeration().hasMoreElements() returns false. Here's the code I am using - public void initialise(){ try { ConnectionFactory connFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); Connection connection = connFactory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); javax.jms.Queue queue = (javax.jms.Queue)jndiUtil.getJndiEntry(queueName); browser = session.createBrowser(queue); connection.start(); } catch (NamingException e) { System.err.println("Got NamingException : " + e.getMessage()); } catch (JMSException e) { System.err.println("Got JMSException : " + e.getMessage()); } } public void browseMessages { try { Enumeration msgEnum = browser.getEnumeration(); System.out.println("has more elements is " + msgEnum.hasMoreElements()); }catch (JMSException e) { System.err.println("Got JMSException : " + e.getMessage()); } } The initialise() method is called before the sender sends messages to the queue and the browseMessages() method is called after the sender has sent a message. Could you please advise me about this? Apologies if I am missing something obvious. Thanks, Priya -- View this message in context: http://www.nabble.com/QueueBrowser-in-embedded-broker-not-getting-any-messages-tf2677079.html#a7466254 Sent from the ActiveMQ - User mailing list archive at Nabble.com.