Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 281 invoked from network); 31 Aug 2009 08:47:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Aug 2009 08:47:34 -0000 Received: (qmail 69957 invoked by uid 500); 31 Aug 2009 08:47:34 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 69894 invoked by uid 500); 31 Aug 2009 08:47:34 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 69883 invoked by uid 99); 31 Aug 2009 08:47:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Aug 2009 08:47:33 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chubrilo@gmail.com designates 209.85.219.220 as permitted sender) Received: from [209.85.219.220] (HELO mail-ew0-f220.google.com) (209.85.219.220) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Aug 2009 08:47:23 +0000 Received: by ewy20 with SMTP id 20so2499596ewy.45 for ; Mon, 31 Aug 2009 01:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=sIwBmQdln2JDek+NBsqizR20O0lyFkXAiPTOkherZeE=; b=qcGrA/M3QZrD6ZEs99Q6bIOPpW92Hbc2xqJ7ez/e8Oenr7jIkmnFpzJ2bmjTjddyvX e1nVTYB9bqPcn7FTBxZ22kW6lkk6ZR6zE3V7zkxdkgL0Y7dAkBgQtS6pNUyvjLQHGgXC 0BKBxxAeTHWs0UpuP/6FylIqbCfK1NaV73UpY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=oLw+NH7ljVtvh3qQSJJnnngnuxVAKyXzaMDjzl0u1M/1rScPDaub4jR337j7+8TSeA Z0xW6erdgnqMV3Nujxp+f8YIdu8TC5cZNWBwC2AuUvpE4EiCRHMKYmn/iF+ZijSi8Nlq S6D8HePj9UdyVj/XivQBfyJaApSGE69/tWVdU= MIME-Version: 1.0 Sender: chubrilo@gmail.com Received: by 10.216.25.209 with SMTP id z59mr1093271wez.204.1251708422114; Mon, 31 Aug 2009 01:47:02 -0700 (PDT) In-Reply-To: <25204754.post@talk.nabble.com> References: <25204754.post@talk.nabble.com> Date: Mon, 31 Aug 2009 10:47:02 +0200 X-Google-Sender-Auth: 88dd66cbda2a7dca Message-ID: <36e91d9d0908310147q5d6bab24r516064724752f346@mail.gmail.com> Subject: Re: ActiveMQ queue - JNDI lookup From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=0016e6d56694dcd64204726c136d X-Virus-Checked: Checked by ClamAV on apache.org --0016e6d56694dcd64204726c136d Content-Type: text/plain; charset=ISO-8859-1 Hi, can you use jconsole to see what queues do you have and does the queue contains the message? Cheers -- Dejan Bosanac Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Sat, Aug 29, 2009 at 7:28 PM, moonbird wrote: > > Hi, > could it be, that i can not lookup destinations which are in the global > jndi > namespace of jboss ? > i used activemq embedded in jboss5 via JCA with a ressource adapter. > ...stationInfoQueue = (Queue) ctx.lookup("stationInfoQueue"); doesnt get > null - but it also doenst work (the consument on the other side doenst get > anything from the queue) > > this is a jndi list from the jboss administration web console: > +- stationInfoQueue (class: org.apache.activemq.command.ActiveMQQueue) > > some posting threads ago, i had a posting about looking up the > ConnectionFactory which also doesnt work. So i used the > queueConnectionFactory = new > ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL); and i > thought now i can lookup the destinations via jndi... > > Thx so far ! > > this is my java client code: > // Look up connection factory and queue(destination) > try > { > // this seems to be not work - because ActiveMQ is > embedded in JBoss5 by > JCA/RA > //queueConnectionFactory = (QueueConnectionFactory) > ctx.lookup("activemq/QueueConnectionFactory"); > queueConnectionFactory = new > ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL); > > stationInfoQueue = (Queue) > ctx.lookup("stationInfoQueue"); > > if (queueConnectionFactory == null) > { > System.err.println("NULL for > queueConnectionFactory"); > System.exit(1); > } > > if (stationInfoQueue == null) > { > System.err.println("NULL for > stationInfoQueue"); > System.exit(1); > } > } > catch (NamingException e) > { > System.err.println("JNDI API lookup failed:" + e); > System.exit(1); > } > > // Create connection. Create session from connection; false means > // session is not transacted. Create requestor and text message. > Send > // messages, wait for answer and finally close session and > connection. > try > { > queueConnection = > queueConnectionFactory.createQueueConnection(); > queueSession = > queueConnection.createQueueSession(false, > Session.AUTO_ACKNOWLEDGE); > // obviously this is needed ??? why doesnt it work > to lookup the activemq > queue via jndi ? > stationInfoQueue = > queueSession.createQueue("stationInfoQueue"); > textMessage = > queueSession.createTextMessage(myXMLRequestAsString); > // javax.jms.QueueRequestor creates a TemporaryQueue > for the responses > and provides a request method that sends the request message > // and waits for its reply.This is a basic > request/reply abstraction that > should be sufficient for most uses. > // JMS providers and clients are free to create more > sophisticated > versions. > queueRequestor = new QueueRequestor(queueSession, > stationInfoQueue); > //sends the message and waits until respond is > received > TextMessage answer = (TextMessage) > queueRequestor.request(textMessage); > System.out.println("CLIENT: Response message > received: "); > System.out.println(answer.getText()); > } > catch (JMSException e) > { > System.out.println("JMSExceptionn occurred:" + e); > } > finally > { > if (queueConnection != null) > { > // close connections > try > { > queueSession.close(); > queueConnection.close(); > } > catch (JMSException e) > { > e.printStackTrace(); > } > } > } > -- > View this message in context: > http://www.nabble.com/ActiveMQ-queue---JNDI-lookup-tp25204754p25204754.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > --0016e6d56694dcd64204726c136d--