Package javax.jms

Examples of javax.jms.TopicSession.createTopic()


            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();

            // Send messages which don't match and do match the selector, checking message count
            TopicSession pubSession = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
            Topic topic = pubSession.createTopic(SELECTOR_TOPIC_NAME);
            TopicPublisher publisher = pubSession.createPublisher(topic);

            publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "false");
            pubSession.commit();
            assertEquals("DurableSubscription backing queue should still have 1 message on it",
View Full Code Here


            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();

            // Send new message matching the topic, checking message count
            TopicSession session = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
            Topic topic = session.createTopic(TOPIC_NAME);
            TopicPublisher publisher = session.createPublisher(topic);

            publishMessages(session, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "indifferent");
            session.commit();
            assertEquals("DurableSubscription backing queue should now have 2 messages on it",
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

                                      String topic,
                                      String selector,
                                      JMSListener listener) throws JMSException {
    TopicSession session = ((TopicConnection)connection).
            createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    Topic jmsTopic = session.createTopic(topic);
    MessageConsumer consumer = session.createConsumer(jmsTopic, selector, true);
    consumer.setMessageListener(listener);
  }

  private void initializeQueue(Connection connection,
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

            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

            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();

            // Send messages which don't match and do match the selector, checking message count
            TopicSession pubSession = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
            Topic topic = pubSession.createTopic(SELECTOR_TOPIC_NAME);
            TopicPublisher publisher = pubSession.createPublisher(topic);

            BDBStoreUpgradeTestPreparer.publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "false");
            pubSession.commit();
            assertEquals("DurableSubscription backing queue should still have 1 message on it",
View Full Code Here

            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();

            // Send new message matching the topic, checking message count
            TopicSession session = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
            Topic topic = session.createTopic(TOPIC_NAME);
            TopicPublisher publisher = session.createPublisher(topic);

            BDBStoreUpgradeTestPreparer.publishMessages(session, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "indifferent");
            session.commit();
            assertEquals("DurableSubscription backing queue should now have 2 messages on it",
View Full Code Here

        {
          oTopic = (Topic) oJndiCtx.lookup(sJndiName);
        }
        catch (NamingException ne)
        {
          oTopic = oSess.createTopic(sJndiName);
        }
        m_oJmsConn = oTC;
        m_oJmsSess = oSess;
        oTC.start();
        m_oCmdSrc = oSess.createSubscriber(oTopic, sMsgSelector, true);
View Full Code Here

    }

    private void produceMessages() throws Exception {
        TopicConnection connection = createConnection();
        TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic topic = session.createTopic(TOPICNAME);
        TopicPublisher producer = session.createPublisher(topic);
        connection.start();
        producer.setDeliveryMode(DeliveryMode.PERSISTENT);
        long tStamp = System.currentTimeMillis();
        BytesMessage message = session2.createBytesMessage();
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.