6.6.2. JNDI Properties

6.6.2. JNDI Properties

From a Java JMS perspective, we will be using topics, which are implemented using an AMQP topic exchange in MRG Messaging. The following properties file creates the topics we need.

java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory

# register some connection factories
# connectionfactory.[jndiname] = [ConnectionURL]
connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'

# register some topics in JNDI using the form
# topic.[jndiName] = [physicalName]
topic.usa.weather = usa.weather,control
topic.usa.news = usa.news,control
topic.europe.weather = europe.weather,control
topic.europe.news = europe.news,control
topic.weather = #.weather,control
topic.news = #.news,control
topic.europe = europe.#,control
topic.usa = usa.#,control
topic.control = control

In the above JNDI file, note that we can map more than one key to a given topic. For instance, topic.usa.weather = usa.weather,control places both messages with the routing key usa.weather and the routing key control on topic.usa.weather.