From users-return-30483-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Thu Mar 22 15:25:12 2012 Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A7E5C952F for ; Thu, 22 Mar 2012 15:25:12 +0000 (UTC) Received: (qmail 20493 invoked by uid 500); 22 Mar 2012 15:25:12 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 20451 invoked by uid 500); 22 Mar 2012 15:25:12 -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 20441 invoked by uid 99); 22 Mar 2012 15:25:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2012 15:25:12 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gary.tully@gmail.com designates 209.85.216.171 as permitted sender) Received: from [209.85.216.171] (HELO mail-qc0-f171.google.com) (209.85.216.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2012 15:25:07 +0000 Received: by qcsp15 with SMTP id p15so1533273qcs.2 for ; Thu, 22 Mar 2012 08:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=YDo8OLiHN+bIQ38xdBebiIGFzrkXq0OHiAVeY7g1fmc=; b=ArQ+gsCteLQlf9GHJy5wTqMET+EtjzbKzo8cH5LTx92b66p5K5Los3QxtHh+k+iNUF aSnqPnz9/prawV7hkOd2OK6hBksklc3ZCQrnZ/n32RxdZEqi0L8zLwVGdS0iZzv48/LO pszqpTXDjhdEp5tIYBFfpQTAa/6o7GVMlDGTVBs78G1Nmk1Dp3wXoVpqnY4s6ytWxhFV g5c8/SKVWaTIEFFD15fH88OMN+lB7BHtc/3F6I+7yggzF6UnnktrQ2X1DpVPgvDB37q4 YGRkepHSInGfg56Tk7jpi1qr5ZjzWZoZb3wvF+fcoAPyo/wNIMQHFkOHQS509qJ35l8P v5Mg== MIME-Version: 1.0 Received: by 10.224.9.141 with SMTP id l13mr11339324qal.52.1332429886900; Thu, 22 Mar 2012 08:24:46 -0700 (PDT) Received: by 10.229.158.4 with HTTP; Thu, 22 Mar 2012 08:24:46 -0700 (PDT) In-Reply-To: <1332408514487-4494989.post@n4.nabble.com> References: <1332408514487-4494989.post@n4.nabble.com> Date: Thu, 22 Mar 2012 15:24:46 +0000 Message-ID: Subject: Re: Configuring Destinations in activemq's JNDI initial Context From: Gary Tully To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org The ActiveMQ initial context is really just an in-memory hash map, it does not know about the broker. You could remove the values to the external jndi.properties file so they are externalized from the client code. Destinations in activemq are created on demand, they don't need to be pre configured, so another option is to use the dynamicQueue context[1] to look up a destination, this requires changing the name that the client uses for the destination lookup however. The third option is to extend the ActiveMQInitialContextFactory to do what you need, an maybe have the root context be dynamic, so that any lookup results in a queue. It may be necessary to differentiate topics and queues though in some way. [1] http://activemq.apache.org/jndi-support.html#JNDISupport-Dynamicallycre= atingdestinations On 22 March 2012 09:28, craigwarren wrote: > Hi, > > I'm trying to create an application which uses JMS message queues, but in > order to support production and development environment I need to be able= to > use both Apache ActiveMQ and Oracle AQ. > > I use spring to do jndi lookups of the destinations... below is the confi= gI > use when connecting to Oracle AQ: > > =A0 =A0 > =A0 =A0 =A0 =A0java.naming.factory.initial =3D weblogic.jndi.WLInitialCon= textFactory > =A0 =A0 =A0 =A0java.naming.provider.url =3D ${jndi.jms.naming.url} > =A0 =A0 =A0 =A0queue.handlersDest =3D t3://localhost:7001 > =A0 =A0 > > > But when I connect to ActiveMQ I have to add an extra property to the > environment: > > =A0 =A0 > =A0 =A0 =A0 =A0java.naming.factory.initial =3D > org.apache.activemq.jndi.ActiveMQInitialContextFactory > =A0 =A0 =A0 =A0java.naming.provider.url =3D tcp://0.0.0.0:61616 > =A0 =A0 =A0 =A0queue.handlersDest =3D handlersDest > =A0 =A0 > > > The extra property (queue.handlersDest =3D handlersDest) seems to be aski= ng > activeMQ to put the queue physically named "handlersDest" in the jndi nam= e > "queue.handlersDest". I want to know if there is any way this can be done= in > advance, and not by the client using the destination. > > Can I configured activemq.xml to pre-set this naming? I would rather not > have that property in my client application if I can avoid it. > > Craig > > -- > View this message in context: http://activemq.2283324.n4.nabble.com/Confi= guring-Destinations-in-activemq-s-JNDI-initial-Context-tp4494989p4494989.ht= ml > Sent from the ActiveMQ - User mailing list archive at Nabble.com. --=20 http://fusesource.com http://blog.garytully.com