activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: [Spam: 5.0] Message is not delivered and disappears
Date Fri, 09 Mar 2007 17:30:05 GMT
On 3/9/07, cmathrusse <Christopher.Mathrusse@sybase.com> wrote:
>
> Yes, the change to port 2100 was intentional. The activemq.xml file on the
> server was updated to this value. If it hadn't been I would not have been
> able to connect to it.
>
> My server application is using the JmsTemplate but that is not the issue as
> I am using ConnectionPooling.

How just out of interest?


> I've managed to get things to work a bit. I modified both my simple client
> and the client application by including a jndi.properties file in their
> classpath. The simple java client was able to connect successfully and
> perform a lookup of the queues, which I had predefined on the server.

FWIW you don't need to predefine queues on the server...
http://activemq.apache.org/how-do-i-create-new-destinations.html


>  I was
> able to find, using the simple java client, the queue with a
> ctx.lookup(queueName);, and send a message successfully. The consumer/server
> application received this message successfully.

Great


> Next I tried from the 3rd
> party client application, but the lookup still failed.

Was the 3rd party client using the same jndi.properties and expecting
things in the same places?


> So I modified the
> lookup to use the dynamic queue syntax,
> ctx.lookup("dynamicQueues/order.request.queue");. This worked and the
> application was able to send successfully.

Great!

> Surprisingly the consumer received the message and was able to process it.

:)


> The only modification I made on the consumer side was that I changed the
> queue name that it was listening on. Previously I had it listening to
> "dynamicQueues/order.request.queue" and I changed it to
> "order.request.queue". For some reason removing the dynamicQueues syntax
> seemed to correct the problem.
>
> I wish I had a good explanation for this.

So I think JNDI has caused most of the grief in this - for most of the
time its kinda an unnecessary level of indirection that just causes
work (setting up the damn jndi contexts) and causes confusion.

Really in JMS destinations are just URIs - you don't need to use JNDI
for them. Imagine if the Servlet spec said you had to register every
URI you were gonna use in a servlet engine in JNDI!

To actually answer your final question - you're confusing the JNDI
lookup name with the JMS destination name. The JNDI name

"dynamicQueues/order.request.queue"

means use queue "order.request.queue"

Its the same as doing

new ActiveMQQueue("order.request.queue")

which is the easiest.

Or via jms

session.createQueue("order.request.queue" )

-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message