Package javax.jms

Examples of javax.jms.TopicConnection.createTopicSession()


            props.put("topic.topicName", topicName);
            javax.naming.Context ctx = new InitialContext(props);
            TopicConnectionFactory factory = (TopicConnectionFactory) ctx.lookup("ConnectionFactory");
            TopicConnection conn = factory.createTopicConnection();
            Topic topic = (Topic) ctx.lookup("topicName");
            TopicSession session = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
            TopicPublisher publisher = session.createPublisher(topic);
            if (message != null) {
                Message msg = session.createTextMessage(message);
                publisher.send(msg);
            }
View Full Code Here


           
            topicConnectionFactory = new ActiveMQConnectionFactory(CONNECTION_URL);
            try {
                topic = new ActiveMQTopic(TOPIC_NAME);
                topicConnection = topicConnectionFactory.createTopicConnection();
                topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
                topicPublisher = topicSession.createPublisher(topic);
                message = topicSession.createMessage();
            } catch (Exception ex) {
                exceptions.add(ex);
            }
View Full Code Here

        m_acknowledgeMode = Session.DUPS_OK_ACKNOWLEDGE;

        // create the message publisher
        final TopicConnection connection = (TopicConnection) m_connectionManager.getConnection(m_connectionName);
        if (connection != null) {
            m_session = connection.createTopicSession(false, m_acknowledgeMode);
            final Topic topic = m_session.createTopic(m_topicName);
            m_publisher = m_session.createPublisher(topic);
        }
        else {
            if (getLogger().isWarnEnabled()) {
View Full Code Here

        m_acknowledgeMode = Session.DUPS_OK_ACKNOWLEDGE;

        // register this MessageListener with a TopicSubscriber
        final TopicConnection connection = (TopicConnection) m_jmsConnectionManager.getConnection(m_connectionName);
        if (connection != null) {
            m_session = connection.createTopicSession(false, m_acknowledgeMode);
            final Topic topic = m_session.createTopic(m_topicName);
            if (m_subscriptionId != null) {
                m_subscriber = m_session.createDurableSubscriber(topic, m_subscriptionId, m_selector, false);
            }
            else {
View Full Code Here

        try {
            /* Create a connection to the topic */
            tc = tcf.createTopicConnection("system", "system");
            /* Create a session on top of the connection which will be used only for
            sending messages, transacted and with auto-acknowledge-mode*/
            s_send = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* Create sessions on top of the connection which will be used only for
            receiving messages, transacted and with auto-acknowledge-mode */
            s_rec1 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            s_rec2 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* start the connection */
 
View Full Code Here

            /* Create a session on top of the connection which will be used only for
            sending messages, transacted and with auto-acknowledge-mode*/
            s_send = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* Create sessions on top of the connection which will be used only for
            receiving messages, transacted and with auto-acknowledge-mode */
            s_rec1 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            s_rec2 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* start the connection */
            tc.start();
            /* Create the receivers */
            TopicSubscriber ts1 = s_rec1.createSubscriber(t, "size >= 5 OR (size < 5 AND color ='green')", false);
View Full Code Here

            sending messages, transacted and with auto-acknowledge-mode*/
            s_send = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* Create sessions on top of the connection which will be used only for
            receiving messages, transacted and with auto-acknowledge-mode */
            s_rec1 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            s_rec2 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* start the connection */
            tc.start();
            /* Create the receivers */
            TopicSubscriber ts1 = s_rec1.createSubscriber(t, "size >= 5 OR (size < 5 AND color ='green')", false);
            TopicSubscriber ts2 = s_rec1.createSubscriber(t);
View Full Code Here

            final String type = Long.toString(start);
            /* Create a connection to the topic */
            tc = tcf.createTopicConnection("system", "system");
            /* Create a session on top of the connection which will be used only for
            sending messages, transacted and with auto-acknowledge-mode*/
            s_send = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* Create sessions on top of the connection which will be used only for
            receiving messages, transacted and with auto-acknowledge-mode */
            s_rec1 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            s_rec2 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* start the connection */
 
View Full Code Here

            /* Create a session on top of the connection which will be used only for
            sending messages, transacted and with auto-acknowledge-mode*/
            s_send = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* Create sessions on top of the connection which will be used only for
            receiving messages, transacted and with auto-acknowledge-mode */
            s_rec1 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            s_rec2 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* start the connection */
            tc.start();
            /* Create the receivers */
            TopicSubscriber ts1 = s_rec1.createSubscriber(t);
View Full Code Here

            sending messages, transacted and with auto-acknowledge-mode*/
            s_send = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* Create sessions on top of the connection which will be used only for
            receiving messages, transacted and with auto-acknowledge-mode */
            s_rec1 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            s_rec2 = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
            /* start the connection */
            tc.start();
            /* Create the receivers */
            TopicSubscriber ts1 = s_rec1.createSubscriber(t);
            TopicSubscriber ts2 = s_rec1.createSubscriber(t);
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.