Package org.apache.activemq

Examples of org.apache.activemq.ActiveMQConnectionFactory.createTopicConnection()


  }

  private void registerDurableSubscription() throws JMSException
  {
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://" + brokerName);
    TopicConnection connection = connectionFactory.createTopicConnection();
    connection.setClientID(clientID);
    TopicSession topicSession = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    Topic topic = topicSession.createTopic(topicName);
    TopicSubscriber durableSubscriber = topicSession.createDurableSubscriber(topic, durableSubName);
    connection.start();
View Full Code Here


  }

  private Message collectMessagesFromDurableSubscriptionForOneMinute() throws Exception
  {
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://" + brokerName);
    TopicConnection connection = connectionFactory.createTopicConnection();

    connection.setClientID(clientID);
    TopicSession topicSession = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    Topic topic = topicSession.createTopic(topicName);
    connection.start();
View Full Code Here

    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);
View Full Code Here

        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);
    }
View Full Code Here

           
            topicConnectionFactory = new ActiveMQConnectionFactory(connectionURL);
            try {
               
                topic = new ActiveMQTopic(topicName);
                topicConnection = topicConnectionFactory.createTopicConnection();
                topicConnection.setClientID((clientId));
                topicConnection.start();
               
                topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
                topicSubscriber = topicSession.createDurableSubscriber(topic, (clientId));
View Full Code Here

    private TopicConnection createConnection() throws Exception
    {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL(connectionUri);
        TopicConnection conn = connectionFactory.createTopicConnection();
        return conn;
    }

}
View Full Code Here

            topicConnectionFactory = new ActiveMQConnectionFactory(connectionURL);
            try {

                topic = new ActiveMQTopic(topicName);
                topicConnection = topicConnectionFactory.createTopicConnection();
                topicConnection.setClientID((clientId));
                topicConnection.start();

                topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
                topicSubscriber = topicSession.createDurableSubscriber(topic, (clientId));
View Full Code Here

           
            topicConnectionFactory = new ActiveMQConnectionFactory(connectionURL);
            try {
               
                topic = new ActiveMQTopic(topicName);
                topicConnection = topicConnectionFactory.createTopicConnection();
                topicConnection.setClientID((clientId));
                topicConnection.start();
               
                topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
                topicSubscriber = topicSession.createDurableSubscriber(topic, (clientId));
View Full Code Here

            broker.setPersistent(false);
            broker.setUseJmx(true);
            broker.addConnector(connector);
            broker.start();
            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
            connection = connectionFactory.createTopicConnection();
            connection.setClientID(MessageManager.class.getName());
            connection.start();
            session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        } catch (Exception e) {
            // TODO
View Full Code Here

    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);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.