Package javax.jms

Examples of javax.jms.TopicConnectionFactory.createTopicConnection()


        durSession.unsubscribe(SUB_NAME);
        durSession.close();
        durConnection.close();

        //create and register a durable subscriber with a 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, "testprop='true'", false);
        durConnection2.start();
        durSub2.close();
        durSession2.close();
View Full Code Here


            _logger.error("problems restarting broker: " + e);
            throw e;
        }
       
        //send messages matching and not matching the selector
        TopicConnection pubConnection = factory.createTopicConnection("guest", "guest");
        TopicSession pubSession = pubConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicPublisher publisher = pubSession.createPublisher(topic);
        for (int i = 0; i < 5; i++)
        {
            Message message = pubSession.createMessage();
View Full Code Here

       
        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);
View Full Code Here

        durSession.unsubscribe(SUB_NAME);
        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();
View Full Code Here

            _logger.error("problems restarting broker: " + e);
            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();
View Full Code Here

                    return connections.get(JMSType.TOPIC);
                }
                else
                {
                    TopicConnectionFactory ccf = (TopicConnectionFactory) createOrReturnConnectionFactory();
                    TopicConnection qc = ccf.createTopicConnection();
                    connections.put(JMSType.TOPIC, qc);

                    return qc;
                }
View Full Code Here

            TopicConnectionFactory tcf =
                (TopicConnectionFactory) ctx.lookup(_tcfName);
            Topic topic = (Topic) ctx.lookup(_topicName);
            ctx.close();

            _connection = tcf.createTopicConnection();

            // false == not transacted.
            _session = _connection.createTopicSession
                (false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

                    return connections.get(JMSType.TOPIC);
                }
                else
                {
                    TopicConnectionFactory ccf = (TopicConnectionFactory) createOrReturnConnectionFactory();
                    TopicConnection qc = ccf.createTopicConnection();
                    connections.put(JMSType.TOPIC, qc);

                    return qc;
                }
View Full Code Here

            context.rebind(XA_TOPIC_CONNECTION_FACTORY, xaTopicConnectionFactory);

            // 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();
View Full Code Here

  TopicConnection oTconn = null;
  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();
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.