Package javax.jms

Examples of javax.jms.QueueSession.createReceiver()


                           
                            selector = "JMSCorrelationID = '" + generateUniqueSelector(ret) + "'";
                        }
                       
                        ret.destination(destination);
                        MessageConsumer consumer = session.createReceiver(destination, selector);
                        ret.consumer(consumer);
                    } else {
                        // no pooled session available in either cache => create one in
                        // in the reply capable cache
                        //
View Full Code Here


           
        } else {
            destination = session.createTemporaryQueue();
        }
       
        MessageConsumer consumer = session.createReceiver((Queue)destination, selector);
        return new PooledSession(session,
                                 destination,
                                 session.createSender(null),
                                 consumer);
    }
View Full Code Here

    private PooledSession createPointToPointServerSession(Destination destination) throws JMSException {
        QueueSession session =
            ((QueueConnection)theConnection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
       
        return new PooledSession(session, destination, session.createSender(null),
                                 session.createReceiver((Queue)destination,
                                                        runtimePolicy.getMessageSelector()));
    }


    /**
 
View Full Code Here

    {
        Queue queue = new AMQAnyDestination("ADDR:my-queue; {create: always}");
        Topic topic = new AMQAnyDestination("ADDR:amq.topic/test");
       
        QueueSession qSession = ((AMQConnection)_connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueReceiver receiver = qSession.createReceiver(queue);
       
        TopicSession tSession = ((AMQConnection)_connection).createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicSubscriber sub = tSession.createSubscriber(topic);
       
        Session ssn = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

                context.lookup(AQInitialContextFactory.QUEUE_CONNECTION_FACTORY);
            connection = queueConnectionFactory.createQueueConnection();
            session = connection.createQueueSession(false,
            QueueSession.AUTO_ACKNOWLEDGE);
            Queue queue = (Queue) context.lookup(qName);
            messageConsumer = session.createReceiver(queue);
            connection.start();
            TextMessage receiveMessage = session.createTextMessage(MESSAGE_CONTENT);
            while (receiveMessage!=null) {
                receiveMessage = (TextMessage) messageConsumer.receive(10);
                if (receiveMessage!=null) System.out.println("Drain:" + receiveMessage.getText());
View Full Code Here

            connection = queueConnectionFactory.createQueueConnection();
            session = connection.createQueueSession(false,
            QueueSession.AUTO_ACKNOWLEDGE);
            Queue queue = (Queue) context.lookup(qName);
            messageProducer = session.createSender(queue);
            messageConsumer = session.createReceiver(queue);
            connection.start();
            TextMessage sendMessage = session.createTextMessage(MESSAGE_CONTENT);
            messageProducer.send(sendMessage);
            TextMessage receiveMessage = (TextMessage) messageConsumer.receive(2000);
            String receiveContent = receiveMessage.getText();
View Full Code Here

                context.lookup(AQInitialContextFactory.XA_QUEUE_CONNECTION_FACTORY);
            connection = queueConnectionFactory.createXAQueueConnection();
            session = connection.createQueueSession(false,
            QueueSession.AUTO_ACKNOWLEDGE);
            Queue queue = (Queue) context.lookup(qName);
            messageConsumer = session.createReceiver(queue);
            connection.start();
            TextMessage receiveMessage = session.createTextMessage(MESSAGE_CONTENT);
            while (receiveMessage!=null) {
                receiveMessage = (TextMessage) messageConsumer.receive(10);
                if (receiveMessage!=null) System.out.println("Drain:" + receiveMessage.getText());
View Full Code Here

            connection = xaQueueConnectionFactory.createXAQueueConnection();
            session = connection.createQueueSession(false,
            QueueSession.AUTO_ACKNOWLEDGE);
            Queue queue = (Queue) context.lookup(qName);
            messageProducer = session.createSender(queue);
            messageConsumer = session.createReceiver(queue);
            connection.start();
            TextMessage sendMessage = session.createTextMessage(MESSAGE_CONTENT);
            messageProducer.send(sendMessage);
            TextMessage receiveMessage = (TextMessage) messageConsumer.receive(2000);
            String receiveContent = receiveMessage.getText();
View Full Code Here

  oQconn = qcf.createQueueConnection();
  oQsess = oQconn.createQueueSession(false
      ,QueueSession.AUTO_ACKNOWLEDGE);
    Queue oQueue
      = (Queue) oCtx.lookup(p_sJndi);
    QueueReceiver oRcv = oQsess.createReceiver(oQueue);
    oQconn.start();
    return oRcv;
      } finally {
          NamingContextPool.releaseNamingContext(oCtx) ;
      }
View Full Code Here

          oQ = oSess.createQueue(sJndiName);
        }
        oQC.start();
        m_oJmsConn = oQC;
        m_oJmsSess = oSess;
        m_oCmdSrc = oSess.createReceiver(oQ, sMsgSelector);
      }
      }
      finally
      {
          NamingContextPool.releaseNamingContext(oJndiCtx) ;
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.