Package javax.jms

Examples of javax.jms.TopicConnection.createTopicSession()


   {
      TopicConnection conn1 = ((TopicConnectionFactory)cf).createTopicConnection();
      TopicConnection conn2 = ((TopicConnectionFactory)cf).createTopicConnection();
     
      TopicSession sess1 = conn1.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      TopicSession sess2 = conn2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
     
      TopicSubscriber sub1 = sess1.createSubscriber(topic);
      TopicSubscriber sub2 = sess2.createSubscriber(topic);
     
      conn1.start();
View Full Code Here


      TopicConnectionFactory cf = (TopicConnectionFactory)ic.lookup("/ConnectionFactory");
      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);
View Full Code Here

   }
  
   public void testCreateQueueOnATopicSession() throws Exception
   {
      TopicConnection c = (TopicConnection)cf.createConnection();
      TopicSession s = c.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
     
      try
      {
         s.createQueue("TestQueue");
         fail("should throw IllegalStateException");
View Full Code Here

  
         TopicConnection conn = cf.createTopicConnection();
  
         conn.setClientID("Client1");
  
         TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = s.createProducer(topic);
         prod.setDeliveryMode(DeliveryMode.PERSISTENT);
  
         // Create 1 durable subscription and 1 non-durable subscription
         s.createDurableSubscriber(topic, "Durable1");
View Full Code Here

         assertEquals(0, count);
        
         // Connect again to the same topic
         conn = cf.createTopicConnection();
         conn.setClientID("Client1");
         s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         prod = s.createProducer(topic);
         prod.setDeliveryMode(DeliveryMode.PERSISTENT);
  
         // Send another message
         prod.send(s.createTextMessage("Second one"));
View Full Code Here

  
         conn = cf.createTopicConnection();
  
         conn.setClientID("Client1");
  
         TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = s.createProducer(topic);
         prod.setDeliveryMode(DeliveryMode.PERSISTENT);
  
         // Create 1 durable subscription and 2 non-durable subscription
         s.createDurableSubscriber(topic, "SubscriberA");
View Full Code Here

         assertEquals(0, count.intValue());
        
         // Now connect again and restore the durable subscription
         conn = cf.createTopicConnection();
         conn.setClientID("Client1");
         s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageConsumer cons = s.createDurableSubscriber(topic, "SubscriberA");
        
         count = (Integer)ServerManagement.getAttribute(destObjectName, "AllMessageCount");
         assertEquals(2, count.intValue());
  
View Full Code Here

  
         conn = cf.createTopicConnection();
  
         conn.setClientID("Client1");
  
         TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

         // Create 2 durable subscription and 4 non-durable subscription
         s.createDurableSubscriber(topic, "SubscriberA");
         s.createDurableSubscriber(topic, "SubscriberB");
        
View Full Code Here

        
        
         // Now connect again and restore the durable subscription
         conn = cf.createTopicConnection();
         conn.setClientID("Client1");
         s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         s.createDurableSubscriber(topic, "SubscriberA");
        
         count = (Integer)ServerManagement.getAttribute(destObjectName, "AllSubscriptionsCount");
         assertEquals(2, count.intValue());
        
View Full Code Here

      {
         conn = cf.createTopicConnection();
  
         conn.setClientID("Client1");
  
         TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

         // Create 2 durable subscription and 2 non-durable subscription
         s.createDurableSubscriber(topic, "SubscriberA");
        
         s.createDurableSubscriber(topic, "SubscriberB", "wibble is null", false);
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.