Package javax.jms

Examples of javax.jms.Session.unsubscribe()


      try
      {
         MessageConsumer cons = sess.createDurableSubscriber(topic, subName);
         cons.close();
         sess.unsubscribe(subName);
         log.trace("Successfully created and unsubscribed subscription");
         return true;
      }
      catch (JMSSecurityException e)
      {
View Full Code Here


         assertEquals(NUM_MESSAGES, count);

         durable.close();

         sess1.unsubscribe("mySubscription");
      }
      finally
      {
         if (conn1 != null)
         {
View Full Code Here

            producer.send(tm);
         }

         log.debug("all " + NUM_MESSAGES + " messages sent");

         sess2.unsubscribe("mySubscription1");

         log.debug("unsubscribed 'mySubscription1'");

         conn2.close();
View Full Code Here

         }

         log.debug("unsubscribing mySubscription");

         durable.close();
         sess5.unsubscribe("mySubscription");
         log.debug("unsubscribing done");
         conn5.close();

         // Resubscribe with the same name
         conn6 = cf.createConnection();
View Full Code Here

         assertEquals(NUM_MESSAGES - NUM_TO_RECEIVE, count);

         durable2.close();

         sess2.unsubscribe("mySubscription");
      }
      finally
      {
         if (conn1 != null)
         {
View Full Code Here

         assertEquals(0, count);

         durable2.close();

         sess2.unsubscribe("mySubscription");
      }
      finally
      {
         if (conn1 != null)
         {
View Full Code Here

         Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);

         try
         {
            sess1.unsubscribe("non-existent subscription");
            fail();
         }
         catch (JMSException e)
         {
         }
View Full Code Here

      prod.send(s.createTextMessage("one"));

      log.debug("unsubscribing ...");

      cons.close();
      s.unsubscribe("uzzi");

      log.debug("resubscribing ...");

      MessageConsumer ds = s.createDurableSubscriber(topic, "uzzi");
      conn.start();
View Full Code Here

      assertNull(ds.receive(1000));
     
      ds.close();
     
      s.unsubscribe("uzzi");

      conn.close();
   }

   public void testInvalidSelectorException() throws Exception
View Full Code Here

      TopicSubscriber dursub = s.createDurableSubscriber(topic, "dursub0");

      try
      {
         s.unsubscribe("dursub0");
         fail();
      }
      catch (IllegalStateException e)
      {
         //Ok - it is illegal to ubscribe a subscription if it has active consumers
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.