Package javax.jms

Examples of javax.jms.QueueSession.createReceiver()


            queueConnectionFactory = (QueueConnectionFactory) lookup(ctx, qcfBindingName);
            final QueueConnection queueConnection = queueConnectionFactory.createQueueConnection(username, password);
            queueConnection.start();
            final QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            final Queue queue = (Queue) ctx.lookup(queueBindingName);
            final QueueReceiver queueReceiver = queueSession.createReceiver(queue);
            queueReceiver.setMessageListener(this);
        } catch (final JMSException e) {
            logger.error("Could not read JMS message.", e);
        } catch (final NamingException e) {
            logger.error("Could not read JMS message.", e);
View Full Code Here


         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createReceiver " + session + " queue=" + queue);
         }

         QueueReceiver result = session.createReceiver(queue);
         result = new HornetQRAQueueReceiver(result, this);

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createdReceiver " + session + " receiver=" + result);
View Full Code Here

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createReceiver " + session + " queue=" + queue + " selector=" + messageSelector);
         }

         QueueReceiver result = session.createReceiver(queue, messageSelector);
         result = new HornetQRAQueueReceiver(result, this);

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createdReceiver " + session + " receiver=" + result);
View Full Code Here

         // And the responder
         conn2 = JMSTestCase.cf.createQueueConnection();
         QueueSession sess2 = conn2.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         TestMessageListener listener = new TestMessageListener(sess2);
         QueueReceiver receiver = sess2.createReceiver(HornetQServerTestCase.queue1);
         receiver.setMessageListener(listener);
         conn2.start();

         Message m1 = sess1.createMessage();
         log.trace("Sending request message");
View Full Code Here

        final QueueConnection connection = factory.createQueueConnection();
        connection.start();

        final QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        final Queue replyDestination = session.createTemporaryQueue();
        final QueueReceiver receiver = session.createReceiver(replyDestination);
        final Message message = session.createTextMessage("Test");
        message.setJMSReplyTo(replyDestination);
        final Destination destination = (Destination) ctx.lookup("queue/test");
        final MessageProducer producer = session.createProducer(destination);
        producer.send(message);
View Full Code Here

        final QueueConnection connection = factory.createQueueConnection();
        connection.start();
        try {
            final QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            final Queue replyDestination = session.createTemporaryQueue();
            final QueueReceiver receiver = session.createReceiver(replyDestination);
            final Message message = session.createTextMessage("Test");
            message.setJMSReplyTo(replyDestination);
            final Destination destination = (Destination) ctx.lookup("queue/test");
            final MessageProducer producer = session.createProducer(destination);
            producer.send(message);
View Full Code Here

            final CountDownLatch latch = new CountDownLatch(10);
            final List<String> result = new ArrayList<String>();

            // Set the async listener
            QueueReceiver recv = session.createReceiver(queue);
            recv.setMessageListener(new MessageListener() {

                @Override
                public void onMessage(Message message) {
                    TextMessage msg = (TextMessage)message;
View Full Code Here

         conn = cf.createQueueConnection();
         QueueSession sess = conn.createQueueSession(true, 0);
         JBossMessageProducer producer = (JBossMessageProducer)sess.createProducer(queue1);
         producer.enableOrderingGroup(null);

         QueueReceiver cons = sess.createReceiver(queue1);

         conn.start();

         Message m1 = sess.createTextMessage("testing1");
         Message m2 = sess.createTextMessage("testing2");
View Full Code Here

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createReceiver " + session + " queue=" + queue);
         }

         QueueReceiver result = session.createReceiver(queue);
         result = new HornetQRAQueueReceiver(result, this);

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createdReceiver " + session + " receiver=" + result);
View Full Code Here

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createReceiver " + session + " queue=" + queue + " selector=" + messageSelector);
         }

         QueueReceiver result = session.createReceiver(queue, messageSelector);
         result = new HornetQRAQueueReceiver(result, this);

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createdReceiver " + session + " receiver=" + result);
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.