Package javax.jms

Examples of javax.jms.QueueSession.createConsumer()


            consumerThread.join();
            assertNull(sessionRunnable.error);

            // Drain the queue
            QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = session.createConsumer(queue);
            while (consumer.receiveNoWait() != null);
            session.close();
         }
      }
      finally
View Full Code Here


            consumerThread.join();
            assertNull(sessionRunnable.error);

            // Drain the queue
            QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = session.createConsumer(queue);
            while (consumer.receiveNoWait() != null);
            session.close();
         }
      }
      finally
View Full Code Here

            consumerThread.join();
            assertNull(sessionRunnable.error);

            // Drain the queue
            QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = session.createConsumer(queue);
            while (consumer.receiveNoWait() != null);
            session.close();
         }
      }
      finally
View Full Code Here

         {
            Message message = session.createTextMessage("" + i);
            producer.send(message);
         }
         producer.close();
         consumer = session.createConsumer(queue);
         waitForMessages();
         session.close();
      }
     
      public synchronized MessageConsumer getConsumer() throws Exception
View Full Code Here

      connect();
      try
      {
         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         TemporaryQueue temp = session.createTemporaryQueue();
         session.createConsumer(temp);
         session.close();
         session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         session.createConsumer(temp).close();
      }
      finally
View Full Code Here

         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         TemporaryQueue temp = session.createTemporaryQueue();
         session.createConsumer(temp);
         session.close();
         session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         session.createConsumer(temp).close();
      }
      finally
      {
         disconnect();
      }
View Full Code Here

      connect();
      try
      {
         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         TemporaryQueue temp = session.createTemporaryQueue();
         session.createConsumer(temp);
         disconnect();
         connect();
         session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         try
         {
View Full Code Here

         disconnect();
         connect();
         session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         try
         {
            session.createConsumer(temp).close();
            fail("Should not be able to consume a temporary on different connection");
         }
         catch (JMSException expected)
         {
         }
View Full Code Here

        Queue invalidDestination = new AMQQueue("amq.direct","unknownQ");
        AMQQueue validDestination = new AMQQueue("amq.direct","knownQ");
        QueueSession queueSession = _connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

        // This is the only easy way to create and bind a queue from the API :-(
        queueSession.createConsumer(validDestination);

        QueueSender sender = queueSession.createSender(invalidDestination);
        TextMessage msg = queueSession.createTextMessage("Hello");
        try
        {
View Full Code Here

                                      String selector,
                                      JMSListener listener) throws JMSException {
    QueueSession session = ((QueueConnection)connection).
            createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    Queue queue = session.createQueue(topic);
    MessageConsumer consumer = session.createConsumer(queue, selector, true);
    consumer.setMessageListener(listener);
  }

  private static String trimQuotes(String value) {
    // trim leading and trailing quotes
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.