Configuration for P2P Examples
The configuration for running the code examples in Chapter 4 is similar to that for the Chat application previously. To run the
QBorrower and QLender code, you will need to define two new
queues, LoanRequestQ and LoanResponseQ. In addition to the connection
properties (which are the same as the Chat application), the
jndi.properties file should contain three
additional properties, the connectionFactoryNames property (which is set
to QueueCF), the queue.LoanRequestQ property (which is set to
jms.LoanRequestQ), and finally the
queue.LoanResponseQ property (which
is set to jms.LoanResponseQ). The
jms part of the name for the jms.LoanRequestQ and jms.LoanResponseQ destination property values
is completely arbitrary; you could easily name them mydestination.LoanRequestQ and mydestination.LoanResponseQ. Whatever you
choose for the destination names, just make sure the names in the
jndi.properties file match the physical names
specified in the activemq.xml file.
The jndi.properties file for the examples in Chapter 4 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 = QueueCFqueue.LoanRequestQ = jms.LoanRequestQqueue.LoanREsponseQ = jms.LoanResponseQ
You will also need to define the queues used by the QBorrower and QLender classes. These are defined in the
activemq.xml ...
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