Package javax.jms

Examples of javax.jms.QueueSender.send()


      Message message = session.createBytesMessage();
      ((BytesMessage)message).writeBytes(PAYLOAD);

      for (int i = 0; i < iterationCount; i++)
         sender.send(message, persistence, 4, 0);

      session.close();

      session = queueConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
      queue = (Queue)context.lookup(TEST_QUEUE);
View Full Code Here


      Message message = session.createBytesMessage();
      ((BytesMessage)message).writeBytes(PAYLOAD);

      for (int i = 0; i < iterationCount; i++)
         sender.send(message, persistence, 4, 0);

      session.close();

      QueueSession session1 = queueConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
      QueueSession session2 = queueConnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
View Full Code Here

      Message message = session.createBytesMessage();
      ((BytesMessage)message).writeBytes(PAYLOAD);

      for (int i = 0; i < iterationCount; i++)
         sender.send(message, persistence, 4, 0);

      session.close();

      QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
      QueueConnection queueConnection1 = queueFactory.createQueueConnection();
View Full Code Here

      Queue queue = (Queue)context.lookup(TEST_QUEUE);

      QueueSender sender = session.createSender(queue);

      Message message = session.createMessage();
      sender.send(message);

      session.close();
      getLog().debug("Sent Synch Message");
   }
View Full Code Here

         sender = qs.createSender(dest);
         TextMessage reply = qs.createTextMessage();
         reply.setText(msg + " : " + msgID);
         reply.setIntProperty("UNIQUE_ID", msgID);
         reply.setLongProperty("Elapsed", elapsed);
         sender.send(reply, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, 180000);
         log.info("Message sent");
      }
      finally
      {
         if (sender != null)
View Full Code Here

            TemporaryQueue temp = session.createTemporaryQueue();
            Message message = session.createTextMessage();
            message.setJMSReplyTo(temp);

            QueueSender sender = session.createSender(queue);
            sender.send(message);

            QueueReceiver receiver = session.createReceiver(temp);
            if (receiver.receive(2000) == null)
            {
               state.addError(new Exception("Didn't receive message"));
View Full Code Here

         {
            QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            Queue replyQueue = (Queue)message.getJMSReplyTo();
            QueueSender sender = session.createSender(replyQueue);
            System.out.println("Sending response");
            sender.send(message);
            sender.close();
            session.close();
         }
         catch (Throwable t)
         {
View Full Code Here

         receiver2.setMessageListener(messageListener);
         Message message = session.createMessage();
         queueConnection.start();

         sender1.send(message);
         sender2.send(message);

         synchronized (messageListener)
         {
            while (completed < 2)
            {
View Full Code Here

            while (count < target)
            {
               if (sendCount <= target)
               {
                  for (int i = 0; i < 10 && ++sendCount <= target; ++i)
                     sender.send(message);
               }
               if (receiver.receive(1) != null)
                  ++count;
            }
         }
View Full Code Here

         TextMessage message = session.createTextMessage();
         message.setText("testMDBTimer");
         message.setIntProperty("UNIQUE_ID", 123456789);
         message.setJMSReplyTo(queueB);
         sender.send(message);

         // Get the initial onMessage ack
         Message reply = receiver.receive(30000);
         log.info("onMessage reply: " + reply);
         assertTrue("onMessage reply != null", reply != null);
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.