Package org.apache.activemq

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


    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

    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

    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

        assertNotNull("Unable to read unexpired message", message);
  }

  private void produceExpiredAndOneNonExpiredMessages() throws JMSException {
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://" + brokerName);
        TopicConnection connection = connectionFactory.createTopicConnection();
        TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic topic = session.createTopic(topicName);
        MessageProducer producer = session.createProducer(topic);
        producer.setTimeToLive(TimeUnit.SECONDS.toMillis(1));
        for(int i=0; i<40000; i++)
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.