Package javax.jms

Examples of javax.jms.QueueConnection.createQueueSession()


         QueueRequestor requestor = new QueueRequestor(sess1, HornetQServerTestCase.queue1);
         conn1.start();

         // 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();
View Full Code Here


   {
      QueueConnectionFactory qcf = JMSTestCase.queueCf;

      QueueConnection qc = qcf.createQueueConnection();

      qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      qc.close();
   }

   /**
 
View Full Code Here

        final InitialContext ctx = new InitialContext();
        final QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("java:/JmsXA");
        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");
View Full Code Here

        final InitialContext ctx = new InitialContext();
        final QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("java:/JmsXA");
        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");
View Full Code Here

            QueueConnectionFactory qcf = (QueueConnectionFactory) remoteContext.lookup("jms/RemoteConnectionFactory");
            Queue queue = (Queue) remoteContext.lookup(QUEUE_NAME);

            conn = qcf.createQueueConnection("guest", "guest");
            conn.start();
            session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

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

            // Set the async listener
View Full Code Here

            QueueConnectionFactory qcf = (QueueConnectionFactory) new InitialContext().lookup("java:/RemoteConnectionFactory");
            Queue queue = (Queue) new InitialContext().lookup("java:jboss/" + QUEUE_NAME);

            conn = qcf.createQueueConnection("guest", "guest");
            conn.start();
            session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

            TemporaryQueue replyQueue = session.createTemporaryQueue();

            TextMessage msg = session.createTextMessage("Hello world");
            msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
View Full Code Here

        ReceiverComponent receiver = new ReceiverComponent();
        container.activateComponent(receiver, "receiver");

        QueueConnection qConn = connectionFactory.createQueueConnection();
        QueueSession qSess = qConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueSender qSender = qSess.createSender(queue);
        TextMessage message = qSess.createTextMessage("<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello>world</hello>");
        qSender.send(message);

        receiver.getMessageList().assertMessagesReceived(1);
View Full Code Here

                try {
                    qConFactory = (QueueConnectionFactory) kernel.invoke(
                            JCA_MANAGED_CONNECTION_FACTORY_NAME,
                            "$getResource");
                    qConnection = qConFactory.createQueueConnection();
                    qSession = qConnection.createQueueSession(false,
                            QueueSession.AUTO_ACKNOWLEDGE);
                    qBrowser = qSession.createBrowser(queue);
                    qConnection.start();
                    for (Enumeration e = qBrowser.getEnumeration(); e
                            .hasMoreElements();) {
View Full Code Here

   {
      QueueConnectionFactory qcf = (QueueConnectionFactory)cf;

      QueueConnection qc = qcf.createQueueConnection();

      qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      qc.close();
   }

   /**
 
View Full Code Here

      QueueConnection conn = null;

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

         QueueReceiver cons = sess.createReceiver(queue1);
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.