The hostname of the first server (client process) is ytsvmx01s, the second
one (server process) is ytsvmx02s
here is an extract of my "vm connection"
javax.jms.Connection connection;
BrokerService broker;
.....
// create a new intial context, which loads from jndi.properties
file
context = new javax.naming.InitialContext();
// lookup the connection factory
broker = BrokerFactory.createBroker(new
URI("xbean:activemq.xml"));
broker.start();
// lookup the connection factory
qcf =
(javax.jms.ConnectionFactory)context.lookup("ConnectionFactory");
// qcf = new
ActiveMQConnectionFactory("vm://localhost?brokerConfig=xbean:activemq.xml");
connection = qcf.createConnection("admin", "admin");
....
here is an extract of my file activemq.xml
<broker brokerName="${hostname}" useJmx="true"
xmlns="http://activemq.org/config/1.0" persistent="false">
.....
<transportConnectors>
<transportConnector name="tcp" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
<transportConnector name="vm" uri="vm://${hostname}"/>
</transportConnectors>
<networkConnectors>
<networkConnector name="pool"
uri="static://(tcp://ytsvmx01s:61616,tcp://ytsvmx02s:61616)"
conduitSubscriptions="false" dynamicOnly="true" />
</networkConnectors>
....
here is my jndi.properties file (for ytsvmx02s, the same with vm://ytsvmx01s
for the other server)
java.naming.factory.initial =
org.apache.activemq.jndi.ActiveMQInitialContextFactory
# use the following property to configure the default connector
java.naming.provider.url = vm://ytsvmx02s
# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.Queue1 = Queue1
queue.Queue2 = Queue2
queue.Queue3 = Queue3
--
View this message in context:
http://www.nabble.com/%22Embedded-broker%22%2C-%22network-of-brokers%22-and-%22temporary-queues%22-tp15023996s2354p15037130.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.