Package javax.jms

Examples of javax.jms.TopicSession.createTopic()


    }

    private void initTopic() throws JMSException {
        topicConnection = (TopicConnection) connectionFactory.createConnection();
        TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        topic = topicSession.createTopic(TOPIC_NAME);
    }
}
View Full Code Here


            queueSession.close();


            TopicSession topicSession = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

            AMQTopic topic = (AMQTopic) topicSession.createTopic("silly.topic");

            assertEquals(topic.getExchangeName().toString(), "test.topic");

            AMQTopic tempTopic = (AMQTopic) topicSession.createTemporaryTopic();
View Full Code Here

        try {
            tc = tcf.createTopicConnection("system", "system");
            ts = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

            String tn = "topic-" + System.currentTimeMillis();
            Topic topic = ts.createTopic(tn);

            Topic t = (Topic)ctx.lookup(tn);
            Assert.assertNotNull("topic-handle", t);
            Assert.assertEquals("topic-handle-name", tn, t.getTopicName());
View Full Code Here

        // create connection
        TopicConnection topicConnection = getTopicConnection(brokerConfiguration);
        // create session, subscriber, message listener and listen on that topic
        try {
            TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
            Topic topic = session.createTopic(topicName);
            TopicSubscriber subscriber = session.createSubscriber(topic);
            MessageListener messageListener = new JMSMessageListener(brokerListener);
            subscriber.setMessageListener(messageListener);
            topicConnection.start();
        } catch (JMSException e) {
View Full Code Here

            {
                topic = (Topic)context.lookup(topicName);
            }
            catch (Exception e)
            {
                topic = session.createTopic(topicName);
            }
            if (topic == null)
            {
                topic = session.createTopic(topicName);
            }
View Full Code Here

            {
                topic = session.createTopic(topicName);
            }
            if (topic == null)
            {
                topic = session.createTopic(topicName);
            }
            System.out.println("Topic ready");

            // Registering as a subscriber under the topic
            TopicSubscriber subscriber = session.createDurableSubscriber(topic,"c1");
View Full Code Here

              // Looking for / Creating a topic
              Topic topic = null;
              try
              {
                  topic = session.createTopic(topicName);
                  //topic = (Topic)context.lookup(topicName);
              }
              catch (Exception e)
              {
                  System.err.println("Failed to create Topic");
View Full Code Here

                connection.start();

                TopicSession session = connection.createTopicSession(
                    false, Session.CLIENT_ACKNOWLEDGE);
                Topic topic = null;
                topic = session.createTopic(topic_name);

                if (topic == null) {
                    System.err.println("Failed to get administered object"
                        + " exiting.....");
                    System.exit(-1);
View Full Code Here

                TopicSession session =
                    connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

                // this is not the preferred way to get a topic
                Topic topic = session.createTopic(topic_name);

                if (topic == null)
                {
                    System.err.println("Failed to create topic");
                }
View Full Code Here

                    Topic topic = null;
                    if (cmdline.exists("persistent")) {
                        topic = (Topic)context.lookup(topic_name);
                    } else {
                        topic = session.createTopic(topic_name);
                    }

                    if (topic == null) {
                        System.err.println("Failed to get administered object"
                            + " exiting.....");
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.