Package javax.jms

Examples of javax.jms.TopicConnection.start()


        //now recreate the durable subscriber without selector to check there are no exceptions generated
        //then verify ALL messages sent are received
        TopicConnection durConnection3 = (TopicConnection) factory.createConnection("guest", "guest");
        TopicSession durSession3 = (TopicSession) durConnection3.createSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicSubscriber durSub3 = durSession3.createDurableSubscriber(topic, SUB_NAME);
        durConnection3.start();
       
        for (int i = 1; i <= 10; i++)
        {
            Message message = durSub3.receive(2000);
            if (message == null)
View Full Code Here


            assertEquals("DurableSubscription backing queue should have 1 message on it initially",
                          new Integer(1), dursubQueue.getMessageCount());

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

            assertEquals("DurableSubscription backing queue should have 1 message on it initially",
                          new Integer(1), dursubQueue.getMessageCount());

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

     */
    public void testBindingAndMessageDurabability() throws Exception
    {
        // Create a connection and start it
        TopicConnection connection = (TopicConnection) getConnection();
        connection.start();

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Queue queue = session.createQueue(QUEUE_NAME);
        MessageProducer messageProducer = session.createProducer(queue);

View Full Code Here

        // Restart the broker
        restartBroker();

        // Drain the queue of all messages
        connection = (TopicConnection) getConnection();
        connection.start();
        consumeQueueMessages(connection, true);
    }

    /**
     * Test that all of the committed persistent messages previously sent to
View Full Code Here

    private void prepareDurableSubscriptionWithSelector() throws Exception
    {

        // Create a connection
        TopicConnection connection = _connFac.createTopicConnection();
        connection.start();
        connection.setExceptionListener(new ExceptionListener()
        {
            public void onException(JMSException e)
            {
                e.printStackTrace();
View Full Code Here

     */
    private void prepareDurableSubscriptionWithoutSelector() throws Exception
    {
        // Create a connection
        TopicConnection connection = _connFac.createTopicConnection();
        connection.start();
        connection.setExceptionListener(new ExceptionListener()
        {
            public void onException(JMSException e)
            {
                e.printStackTrace();
View Full Code Here

        }

        if (outboundClientId != null && outboundClientId.length() > 0) {
            newConnection.setClientID(getOutboundClientId());
        }
        newConnection.start();

        outboundMessageConvertor.setConnection(newConnection);

        // Configure the bridges with the new Outbound connection.
        initializeInboundDestinationBridgesOutboundSide(newConnection);
View Full Code Here

        }

        if (localClientId != null && localClientId.length() > 0) {
            newConnection.setClientID(getLocalClientId());
        }
        newConnection.start();

        inboundMessageConvertor.setConnection(newConnection);

        // Configure the bridges with the new Local connection.
        initializeInboundDestinationBridgesLocalSide(newConnection);
View Full Code Here

  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;
      } finally {
          NamingContextPool.releaseNamingContext(oCtx) ;
      }
  } //__________________________________
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.