Package javax.jms

Examples of javax.jms.Topic


   public void testDurableSubscriptionDifferentSelector() throws Exception
   {
      ServerManagement.deployTopic("CompletelyNewTopic2");
     
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/Topic");
      Connection conn = cf.createConnection();

      conn.setClientID("brookeburke");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here


   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Connection conn = cf.createConnection();
      conn.setClientID("doesn't actually matter");
      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      Topic temporaryTopic = s.createTemporaryTopic();

      try
      {
         s.createDurableSubscriber(temporaryTopic, "mySubscription");
         fail("this should throw exception");
View Full Code Here

      }

      ServerManagement.deployTopic("TopicToBeRedeployed");

      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/TopicToBeRedeployed");

      Connection conn = cf.createConnection();
      conn.setClientID("brookeburke");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

   }

   public void testUnsubscribeDurableSubscription() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/Topic");

      Connection conn = cf.createConnection();
      conn.setClientID("ak47");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

   }

   public void testInvalidSelectorException() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/Topic");
      Connection c = cf.createConnection();
      c.setClientID("sofiavergara");
      Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);

      try
View Full Code Here

   //See JMS 1.1. spec sec 6.11
   public void testUnsubscribeWithActiveConsumer() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
      Topic topic = (Topic)ic.lookup("/topic/Topic");

      Connection conn = cf.createConnection();
      conn.setClientID("zeke");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

      Connection c =  cf.createConnection();
      c.setClientID("something");
      try
      {
         Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
         Topic topic = (Topic)ic.lookup("/topic/Topic");

         try
         {
            s.createDurableSubscriber(topic, "somename", "=TEST 'test'", false);
            fail("this should fail");
View Full Code Here

      TopicConnection c =  cf.createTopicConnection();
      c.setClientID("something");
      try
      {
         TopicSession s = c.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         Topic topic = (Topic)ic.lookup("/topic/Topic");

         try
         {
            s.createSubscriber(topic, "=TEST 'test'", false);
            fail("this should fail");
View Full Code Here

   public void testCreateTopic() throws Exception
   {
      Connection conn = cf.createConnection();     
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
     
      Topic topic = sess.createTopic("TestTopic");
     
      MessageProducer producer = sess.createProducer(topic);
      producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
     
      MessageConsumer consumer = sess.createConsumer(topic);
View Full Code Here

         // connecting to the first node

         ic = new InitialContext();

         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
         Topic distributedTopic = (Topic)ic.lookup(destinationName);
         log("Distributed topic " + destinationName + " exists");


         // When connecting to a messaging cluster, the ConnectionFactory has the capability of
         // transparently creating physical connections to different cluster nodes, in a round
View Full Code Here

TOP

Related Classes of javax.jms.Topic

Copyright © 2018 www.massapicom. 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.