You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Antsa <ad...@teamware.com> on 2009/03/13 01:16:37 UTC

How to discover destinations configured in a broker

I'm a newbie to JMS.  I have an embedded broker configured in my Spring XML
config running inside my app.

    <amq:broker brokerName="twoBroker"
dataDirectory="${activemq.base}/data">
       <amq:destinations>
           <amq:topic id="directory" name="ChangePassword"
physicalName="directory.user.changepassword"/>
       </amq:destinations>

        <amq:transportConnectors>
            <amq:transportConnector name="openwire"
uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
            <amq:transportConnector name="vm" uri="vm://twoBroker"/>
        </amq:transportConnectors>
    </amq:broker>

My app is acting as a messaging gateway, receiving non JMS messages from
another system and I'm trying to then put these messages to their JMS topic
destinations.

I'm just using similar code to the ProducerTool example, e.g.

            Session session = connection.createSession(transacted,
Session.AUTO_ACKNOWLEDGE);
            destination = session.createTopic(subject);

but I know I should not be using createTopic() in my real app.  So, how do I
find out what destinations the broker supports and get the Destination
object to procuce the message to.  This is both a local (same vm) and remote
vm issue.

Do I have to use JNDI or is there some other magic that makes this easy?

Thanks
Antony

-- 
View this message in context: http://www.nabble.com/How-to-discover-destinations-configured-in-a-broker-tp22487877p22487877.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How to discover destinations configured in a broker

Posted by Antsa <ad...@teamware.com>.
I managed to get topics bound to JNDI, but only by putting them in
jndi.properties with

java.naming.factory.initial =
org.apache.activemq.jndi.ActiveMQInitialContextFactory
java.naming.provider.url = vm://localhost
topic.directory.user.changepassword = directory.user.changepassword
topic.bla.bla.bla = bla.bla.bla

I don't want to have destinations in two places, I would like to configure
the topics in the broker destinations, or even better in a topic config file
which is then referenced by the broker destinations.

How do I configure things so that my broker configured destinations are
automatically published to JNDI.

Thanks
Antony

-- 
View this message in context: http://www.nabble.com/How-to-discover-destinations-configured-in-a-broker-tp22487877p22489285.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.