users@glassfish.java.net

Re: JMS MDB subscription to topic

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Jul 2008 14:22:29 PDT

> 've debugged the code in the servlet and I see that
> the "Destination" in the MessageProducer still points
> to "PhysicalTopic" and I don't know why.

Check in your project's "Server Resources" directories, there will be a file called sun-resources.xml. This file is Sun server specific and optional. It is used to tell the server what resources your application needs, and to what physical resource it should be linked.
Look for an admin-object-resource tag with jndi-name = your topic name. there will be a child called property containing the name of the destination in the MQ server the jndi name is bound to, and I'm guessing its value will be "PhysicalTopic"

The cause is the new MDB wizard in Netbeans - if you enter a "project destination" it will fill in sun-resources.xml for you with PhysicalQueue or PhysicalTopic as the destination name. You can change what you want in the server, on every deploy that info gets overwritten. But it's only hard to find the first time you encounter it ;-)

About books: sorry, I can't point you to one resource covering everything. Sun's Java EE tutorial is pretty decent, and the usage side of JMS itself isn't that difficult. Regarding the server side, OpenMQ's documentation is very good and complete. There are also some very interesting blog posts of Sun people showing the detailed usage of MDB's in a Glassfish server, it should be easy to find these via Google.

fvu
[Message sent by forum member 'fvu' (fvu)]

http://forums.java.net/jive/thread.jspa?messageID=286094