Package javax.jms

Examples of javax.jms.Session.createMessage()


         m3.setStringProperty("beatle", "george");

         Message m4 = sess.createMessage();
         m4.setStringProperty("beatle", "ringo");

         Message m5 = sess.createMessage();
         m5.setStringProperty("beatle", "jesus");

         MessageProducer prod = sess.createProducer(HornetQServerTestCase.topic1);

         prod.send(m1);
View Full Code Here


      Connection conn = JMSTestCase.cf.createConnection();
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageConsumer consumer = sess.createConsumer(HornetQServerTestCase.topic1);
      MessageProducer producer = sess.createProducer(HornetQServerTestCase.topic1);
      sess.createBrowser(HornetQServerTestCase.queue1);
      Message m = sess.createMessage();

      conn.close();

      // Session
View Full Code Here

      /* If the session is closed then any method invocation apart from close()
       * will throw an IllegalStateException
       */
      try
      {
         sess.createMessage();
         ProxyAssertSupport.fail("Session is not closed");
      }
      catch (javax.jms.IllegalStateException e)
      {
      }
View Full Code Here

        
         ClientConsumer browser = coreSession.createConsumer("jms.queue.Queue1", true);
      
         conn.start();

         Message m = session.createMessage();
         m.setIntProperty("cnt", 0);
         producer.send(m);
        
         
         assertNotNull(browser.receive(5000));
View Full Code Here

         Enumeration<Message> en = (Enumeration<Message>)browser.getEnumeration();

         conn.start();

         Message m = session.createMessage();
         m.setIntProperty("cnt", 0);
         producer.send(m);
         Message m2 = en.nextElement();
        
         assertNotNull(m2);
View Full Code Here

         final int numMessages = 100;

         for (int i = 0; i < numMessages; i++)
         {
            Message m = session.createMessage();
            m.setIntProperty("test_counter", i + 1);
            producer.send(m);
         }
      }
      finally
View Full Code Here

         MessageProducer prod2 = sess2.createProducer(HornetQServerTestCase.queue1);

         for (int i = 0; i < numMessages; i++)
         {
            prod2.send(sess2.createMessage());
         }

         listener.waitForMessages();

         conn.close();
View Full Code Here

         final int numMessages = 100;

         for (int i = 0; i < numMessages; i++)
         {
            prod.send(sess.createMessage());
         }

         conn.start();

         Message msg = cons.receive(3000);
View Full Code Here

         Session sessSend = theConn.createSession(false, Session.AUTO_ACKNOWLEDGE);

         MessageProducer theProducer = sessSend.createProducer(HornetQServerTestCase.queue1);
         theProducer.setDeliveryMode(DeliveryMode.PERSISTENT);

         Message m = sessSend.createMessage();
         m.setStringProperty("p1", "aardvark");

         BytesMessage bm = sessSend.createBytesMessage();
         bm.writeObject("aardvark");
View Full Code Here

      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

      for (int i = 0; i < numMessages; i++)
      {
         Message m = sess.createMessage();

         m.setStringProperty("name", "Watt");

         prod.send(m);
      }
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.