Package javax.jms

Examples of javax.jms.TopicConnection.createTopicSession()


        TopicConnectionFactory factory = getConnectionFactory();
        Topic topic = (Topic) getInitialContext().lookup(_topicName);
       
        //create and register a durable subscriber with selector then unsubscribe it
        TopicConnection durConnection = factory.createTopicConnection("guest", "guest");
        TopicSession durSession = durConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicSubscriber durSub1 = durSession.createDurableSubscriber(topic, SUB_NAME, "testprop='true'", false);
        durConnection.start();
        durSub1.close();
        durSession.unsubscribe(SUB_NAME);
        durSession.close();
View Full Code Here


        durSession.close();
        durConnection.close();

        //create and register a durable subscriber without the message selector and then close it
        TopicConnection durConnection2 = factory.createTopicConnection("guest", "guest");
        TopicSession durSession2 = durConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicSubscriber durSub2 = durSession2.createDurableSubscriber(topic, SUB_NAME);
        durConnection2.start();
        durSub2.close();
        durSession2.close();
        durConnection2.close();
View Full Code Here

            throw e;
        }
       
        //send messages matching and not matching the original used selector
        TopicConnection pubConnection = factory.createTopicConnection("guest", "guest");
        TopicSession pubSession = pubConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicPublisher publisher = pubSession.createPublisher(topic);
        for (int i = 1; i <= 5; i++)
        {
            Message message = pubSession.createMessage();
            message.setStringProperty("testprop", "true");
View Full Code Here

            // Create a connection and start it
            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();
View Full Code Here

            // Create a connection and start it
            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();
View Full Code Here

        durSub1.close();

        // Create a publisher and send a persistent message which matches the selector
        // followed by one that does not match, and another which matches but is not
        // committed and so should be 'lost'
        TopicSession pubSession = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
        TopicPublisher publisher = pubSession.createPublisher(topic);

        publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "true");
        publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "false");
        pubSession.commit();
View Full Code Here

        // Create and register a durable subscriber without selector and then close it
        TopicSubscriber durSub1 = session.createDurableSubscriber(topic, SUB_NAME);
        durSub1.close();

        // Create a publisher and send a persistent message which matches the subscription
        TopicSession pubSession = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
        TopicPublisher publisher = pubSession.createPublisher(topic);

        publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "indifferent");
        pubSession.commit();

View Full Code Here

            // create the topic connection factory
            topicFactory = AQjmsFactory.getTopicConnectionFactory(ds);
            context.rebind(TOPIC_CONNECTION_FACTORY, topicFactory);
            topicConnection = topicFactory.createTopicConnection();
            session = (AQjmsSession) topicConnection.createTopicSession(false,
                    Session.AUTO_ACKNOWLEDGE);
            List<DestinationInfo> list = AQUtil.getDestinationInfoList(ds, aqSchemaName);
            // for each queue
            Iterator<DestinationInfo> iter = list.iterator();
            while (iter.hasNext()) {
View Full Code Here

  TopicSession   oTsess = null;
  TopicConnectionFactory qcf = (TopicConnectionFactory) oCtx
    .lookup("ConnectionFactory");

  oTconn = qcf.createTopicConnection();
  oTsess = oTconn.createTopicSession(false
      ,QueueSession.AUTO_ACKNOWLEDGE);
    Topic oT = (Topic) oCtx.lookup(p_sJndi);
    TopicSubscriber oRcv = oTsess.createSubscriber(oT);
    oTconn.start();
    return oRcv;
View Full Code Here

          COMMAND_IS_TOPIC, "false"));
      if (bIsTopic)
      {
        TopicConnectionFactory tcf = (TopicConnectionFactory) oFactCls;
        TopicConnection oTC = tcf.createTopicConnection();
        TopicSession oSess = oTC.createTopicSession(false,
            TopicSession.AUTO_ACKNOWLEDGE);
        Topic oTopic = null;
        try
        {
          oTopic = (Topic) oJndiCtx.lookup(sJndiName);
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.