mirror of https://github.com/apache/activemq.git
used the new clientIDPrefix and made the code easier to run on Java 5
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@424932 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0094ff7269
commit
387805efeb
|
@ -54,14 +54,18 @@ public class Main {
|
|||
broker = new BrokerService();
|
||||
broker.setPersistent(false);
|
||||
broker.setUseJmx(true);
|
||||
broker.getManagementContext().setCreateConnector(false);
|
||||
broker.setPlugins(new BrokerPlugin[] { new ConnectionDotFilePlugin() });
|
||||
broker.addConnector("tcp://localhost:61616");
|
||||
broker.addConnector("stomp://localhost:61613");
|
||||
}
|
||||
broker.start();
|
||||
|
||||
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
|
||||
factory.setClientIDPrefix("testClient");
|
||||
|
||||
// lets create a dummy couple of consumers
|
||||
Connection connection = new ActiveMQConnectionFactory().createConnection();
|
||||
Connection connection = factory.createConnection();
|
||||
connection.start();
|
||||
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
MessageConsumer consumer1 = session.createConsumer(new ActiveMQQueue("Orders.IBM"));
|
||||
|
|
Loading…
Reference in New Issue