Package javax.jms

Examples of javax.jms.Session.createConsumer()


         conn.close();

         conn = cf.createConnection();
         Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);

         MessageConsumer cons = sess.createConsumer(queue);

         conn.start();

         TextMessage tm = (TextMessage)cons.receive();
View Full Code Here


         sess.rollback();
         sess.close();

         Session sess2 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

         cons = sess2.createConsumer(queue);

         tm = (TextMessage)cons.receive();

         assertEquals("a message", tm.getText());
View Full Code Here

      Connection conn = cf.createConnection();

      Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
      MessageProducer producer = sess.createProducer(queue);
     
      MessageConsumer consumer = sess.createConsumer(queue);
      conn.start();

     
      TextMessage mSent = sess.createTextMessage("igloo");
      producer.send(mSent);
View Full Code Here

   {
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

      try
      {
         sess.createConsumer(dest);
         return true;
      }
      catch (JMSSecurityException e)
      {
         log.trace("Can't read destination");
View Full Code Here

            prod.send(tm);
         }
        
         Session sess2 = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
        
         MessageConsumer cons = sess2.createConsumer(queue);
        
         conn.start();
        
         for (int i = 0; i < NUM_MESSAGES; i++)
         {
View Full Code Here

      conn.start();

      final Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

      MessageConsumer cons = sess.createConsumer(queue);

      final Object lock = new Object();

      final int numMessages = 100;
View Full Code Here

  
         conn.start();
  
         Session sessConsume1 = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
  
         MessageConsumer cons1 = sessConsume1.createConsumer(queue);
  
         TextMessage tm = sessSend.createTextMessage();
  
         tm.setText("Your mum");
  
View Full Code Here

  
         // Create another consumer
  
         Session sessConsume2 = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
  
         MessageConsumer cons2 = sessConsume2.createConsumer(queue);
  
         // this should cancel message and cause delivery to other consumer
  
         log.trace("Closed session 1");
         sessConsume1.close();
View Full Code Here

      {
         Session ps = pconn.createSession(false, Session.AUTO_ACKNOWLEDGE);

         try
         {
            ps.createConsumer(new JBossTopic("NoSuchTopic"));
            fail("should throw exception");
         }
         catch(InvalidDestinationException e)
         {
            // OK
View Full Code Here

         connReceive.start();

         Session sessReceive = connReceive.createSession(true, Session.SESSION_TRANSACTED);

         MessageConsumer cons = sessReceive.createConsumer(queue2);

         TextMessage m2 = (TextMessage)cons.receive(1500);

         assertNotNull(m2);
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.