Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 67549 invoked from network); 21 Nov 2006 09:02:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2006 09:02:01 -0000 Received: (qmail 63382 invoked by uid 500); 21 Nov 2006 09:02:10 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 63371 invoked by uid 500); 21 Nov 2006 09:02:10 -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 63361 invoked by uid 99); 21 Nov 2006 09:02:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2006 01:02:10 -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; Tue, 21 Nov 2006 01:01:57 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GmRVZ-0006VM-HY for activemq-users@geronimo.apache.org; Tue, 21 Nov 2006 01:01:37 -0800 Message-ID: <7467853.post@talk.nabble.com> Date: Tue, 21 Nov 2006 01:01:37 -0800 (PST) From: Marlon Santos To: activemq-users@geronimo.apache.org Subject: Re: QueueBrowser in embedded broker not getting any messages In-Reply-To: <7466254.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: msantos@exist.com References: <7466254.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, I looked into your code, but i can't end into a specific conclusion as to what the problem was... Try to change javax.jms.Queue queue = (javax.jms.Queue)jndiUtil.getJndiEntry(queueName); to queue = session.createQueue(subject); If it fails, can you please paste all the classes that you use in here or just upload and create a link, so that we cant look into it better, because the code you pasted was insufficient. Regards, Marlon Priya Parvatikar wrote: > > 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#a7467853 Sent from the ActiveMQ - User mailing list archive at Nabble.com.