Configuration for Pub/Sub Examples
The ActiveMQ configuration for running the TBorrower and the TLender classes is similar to the
configuration specified in the Chat
application, only the topic name is set to RateTopic rather than topic1. Everything else is the same.
The jndi.properties file for the examples in Chapter 5 is as follows:
java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory java.naming.provider.url = tcp://localhost:61616 java.naming.security.principal=system java.naming.security.credentials=managerconnectionFactoryNames = TopicCFtopic.RateTopic = jms.RateTopic
You will also need to define the topic used by the TBorrower and TLender classes. This is defined in the
activemq.xml file located in the
ACTIVEMQ_HOME/conf directory. You will need to add
a destinations element to the base
configuration as shown here:
.. <destinations> <topic name="RateTopic" physicalName="jms.RateTopic" /> </destinations> ...
In addition to the configuration changes indicated here, you will need to include the activemq-all-5.2.0.jar file in your classpath.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access