Java 类javax.jms.TopicRequestor 实例源码

项目:activemq-artemis    文件:TopicBridgeSpringTest.java   
@Override
protected void setUp() throws Exception {

   super.setUp();
   context = createApplicationContext();
   ActiveMQConnectionFactory fac = (ActiveMQConnectionFactory) context.getBean("localFactory");
   localConnection = fac.createTopicConnection();
   localConnection.start();
   requestServerSession = localConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
   Topic theTopic = requestServerSession.createTopic(getClass().getName());
   requestServerConsumer = requestServerSession.createConsumer(theTopic);
   requestServerConsumer.setMessageListener(this);
   requestServerProducer = requestServerSession.createProducer(null);

   fac = (ActiveMQConnectionFactory) context.getBean("remoteFactory");
   remoteConnection = fac.createTopicConnection();
   remoteConnection.start();
   TopicSession session = remoteConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
   requestor = new TopicRequestor(session, theTopic);
}