mirror of
https://github.com/apache/activemq.git
synced 2025-02-17 07:24:51 +00:00
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 = new BrokerService();
|
||||||
broker.setPersistent(false);
|
broker.setPersistent(false);
|
||||||
broker.setUseJmx(true);
|
broker.setUseJmx(true);
|
||||||
|
broker.getManagementContext().setCreateConnector(false);
|
||||||
broker.setPlugins(new BrokerPlugin[] { new ConnectionDotFilePlugin() });
|
broker.setPlugins(new BrokerPlugin[] { new ConnectionDotFilePlugin() });
|
||||||
broker.addConnector("tcp://localhost:61616");
|
broker.addConnector("tcp://localhost:61616");
|
||||||
broker.addConnector("stomp://localhost:61613");
|
broker.addConnector("stomp://localhost:61613");
|
||||||
}
|
}
|
||||||
broker.start();
|
broker.start();
|
||||||
|
|
||||||
|
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
|
||||||
|
factory.setClientIDPrefix("testClient");
|
||||||
|
|
||||||
// lets create a dummy couple of consumers
|
// lets create a dummy couple of consumers
|
||||||
Connection connection = new ActiveMQConnectionFactory().createConnection();
|
Connection connection = factory.createConnection();
|
||||||
connection.start();
|
connection.start();
|
||||||
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||||
MessageConsumer consumer1 = session.createConsumer(new ActiveMQQueue("Orders.IBM"));
|
MessageConsumer consumer1 = session.createConsumer(new ActiveMQQueue("Orders.IBM"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user