Configuration for Spring JMS Examples
This section contains the ActiveMQ configuration required to run
the Spring JMS examples in Chapter 9. Like the
other examples found in this book, you will need to create a
jndi.properties file (located in your classpath)
with the connectionFactoryNames
property set to QueueCF and the
queue.queue1 property set to jms.queue1:
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 = QueueCFqueue.queue1 = jms.queue1
The jndi.properties file also contains the
JNDI connection information for the JMS provider. You will need to set
the initial context factory class, provider URL, username, and password
needed to connect to the JMS server. To run the examples using ActiveMQ,
you would set the initial context factory to org.apache.activemq.jndi.ActiveMQInitialContextFactory
and the provider URL to tcp://localhost:61616 (the default protocol,
host, and port for ActiveMQ (as shown previously).
You will also need to define the queue used by the Spring JMS
examples, called queue1. This is
defined in the activemq.xml file by adding a
destinations element as shown
here:
.. <destinations> <queue name="queue1" physicalName="jms.queue1" /> </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