Package javax.jms

Examples of javax.jms.Session.unsubscribe()


        // create kipper
        Topic kipper = sess.createTopic("kipper");
        TopicSubscriber subscriber = sess.createDurableSubscriber(kipper, "kipper");

        subscriber.close();
        sess.unsubscribe("kipper");

        //Do something to show connection is active.
        sess.rollback();
        conn.close();
    }
View Full Code Here


        TopicSubscriber subscriber = sess.createDurableSubscriber(kipper, "kipper");

        subscriber.close();
        try
        {
            sess.unsubscribe("kipper");

            //Do something to show connection is active.
            sess.rollback();

            fail("Exception was not thrown");
View Full Code Here

        String topicName = "kipper";
        Topic topic = sess.createTopic(topicName);
        TopicSubscriber subscriber = sess.createDurableSubscriber(topic, topicName);

        subscriber.close();
        sess.unsubscribe(topicName);

        //Do something to show connection is active.
        sess.rollback();
        conn.close();
    }
View Full Code Here

            assertEquals("message" + i, tm.getText());
         }

         cons.close();

         session.unsubscribe("mysub1");
      }
      finally
      {
         if (conn != null)
         {
View Full Code Here

            assertEquals("message" + i, tm.getText());
         }

         cons.close();

         session.unsubscribe("mysub1");
      }
      finally
      {
         if (conn != null)
         {
View Full Code Here

        //check the dur sub's underlying queue now has msg count 0
        assertEquals("Msg count should be 0", 0, ((AMQSession<?, ?>) session2).getQueueDepth(subQueue, true));

        consumer2.close();
        _logger.info("Unsubscribe session2/consumer2");
        session2.unsubscribe("MySubscription");
       
        ((AMQSession<?, ?>) session2).sync();
       
        if(isJavaBroker())
        {
View Full Code Here

        assertNull("There should be no more messages for consumption on consumer3.", msg);

        consumer1.close();
        consumer3.close();

        session3.unsubscribe("MySubscription");

        con.close();
       
        if(restartBroker)
        {
View Full Code Here

        assertNull("There should be no more messages for consumption on consumer3.", msg);

        consumer1.close();
        consumer3.close();

        session3.unsubscribe("MySubscription");

        con0.close();
        con1.close();
        con3.close();
    }
View Full Code Here

      Message msg = liveSubscriber.receive(POSITIVE_RECEIVE_TIMEOUT);
      assertNotNull ("Message should have been received", msg);
      assertEquals ("testDurableWithInvalidSelector2", ((TextMessage) msg).getText());
      assertNull("Should not receive subsequent message", liveSubscriber.receive(200));
        liveSubscriber.close();
        session.unsubscribe("testDurableWithInvalidSelectorSub");
    }
   
    /**
     * This tests the fix for QPID-1085
     * Creates a durable subscriber with an invalid destination, checks that the
View Full Code Here

      Message msg = liveSubscriber.receive(POSITIVE_RECEIVE_TIMEOUT);
      assertNotNull ("Message should have been received", msg);
      assertEquals ("testDurableWithInvalidSelector2", ((TextMessage) msg).getText());
      assertNull("Should not receive subsequent message", liveSubscriber.receive(200));

        session.unsubscribe("testDurableWithInvalidDestinationsub");
    }
   
    /**
     * Creates a durable subscription with a selector, then changes that selector on resubscription
     * <p>
 
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.