Package javax.jms

Examples of javax.jms.TopicSession.unsubscribe()


        publisher.publish(topic2, session1.createTextMessage("goodbye"));
        session1.commit();
        m = (TextMessage) sub2.receive(2000);
        assertNotNull(m);
        assertEquals("goodbye", m.getText());
        session1.unsubscribe("subscription0");
        con.close();
    }

    public void testUnsubscriptionAfterConnectionClose() throws Exception
    {
View Full Code Here


        con2.start();
        tm = (TextMessage) sub.receive(2000);
        session2.commit();
        assertNotNull(tm);
        assertEquals("Hello2", tm.getText());
        session2.unsubscribe("subscription0");
        con1.close();
        con2.close();
    }

    public void testTextMessageCreation() throws Exception
View Full Code Here

            msg = tsub.receiveNoWait();
            Assert.assertNotNull("fourth message", msg);
            Assert.assertEquals("fourth message", new Integer(1005),
                                            ((ObjectMessage)msg).getObject());

            ts.unsubscribe(name);

            om = ts.createObjectMessage(new Integer(num++));
            tp.publish(om);
            om = ts.createObjectMessage(new Integer(num++));
            tp.publish(om);
View Full Code Here

            msg = tsub.receiveNoWait();
            Assert.assertNotNull("fith message", msg);
            Assert.assertEquals("fith message", new Integer(1008),
                                            ((ObjectMessage)msg).getObject());

            ts.unsubscribe(name);

            tsub.close();
            tp.close();

        } finally {
View Full Code Here

                     .createTopicConnection("john", "needle");
               try
               {
                  TopicSession session = topicConnection.createTopicSession(false,
                     Session.AUTO_ACKNOWLEDGE);
                  session.unsubscribe("DurableSubscriberExample");
               }
               finally
               {
                  topicConnection.close();
               }
View Full Code Here

    */
   public void testDummyLast() throws Exception
   {

      TopicSession session = topicDurableConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      session.unsubscribe("test");

      queueConnection.close();
      topicConnection.close();
      topicDurableConnection.close();
   }
View Full Code Here

         getLog().debug("Closing the send session");
         sendSession.close();

         getLog().debug("Removing the subscription");
         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         subSession.unsubscribe("test");

      }
      finally
      {
         getLog().debug("Closing the connection");
View Full Code Here

         assertTrue("Should get Message2", message.getText().equals("Message2"));
         getLog().debug("Closing the subscriber");

         getLog().debug("Removing the subscription");
         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         subSession.unsubscribe("test");
         subSession.close();

      }
      finally
      {
View Full Code Here

      sub1.close();
      sub2.close();
      sub3.close();

      session.unsubscribe("sub1");

      topicConnection.stop();
      topicConnection.close();

      disconnect();
View Full Code Here

    */
   public void removeDurableSubscription() throws Exception
   {

      TopicSession session = topicDurableConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      session.unsubscribe("test");
   }

   /**
    * The JUnit setup method
    *
 
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.