Package javax.jms

Examples of javax.jms.QueueSession.createSender()


    public static void queue (QueueConnectionFactory qcf, Queue queue,
                              DefaultAuditEvent evt, int requeued) {
        QueueConnection qc = null;
        QueueSession qs = null;
        try {
            QueueSender snd = qs.createSender (queue);
            snd.setDisableMessageID (true);
            snd.setDisableMessageTimestamp (true);
            Map args = new HashMap();
            args.put("event", evt.replaceSource(null));
            ObjectMessage msg = qs.createObjectMessage();
View Full Code Here


                        getLogger().logError("Failed to create queue " +
                            queue);
                        System.exit(-1);
                    }

                    QueueSender sender = session.createSender(queue);

                    // check the number of iterations that have been
                    // specified on the command line. If it has not been
                    // specified then default to 1.
                    int count = 1;
View Full Code Here

        QueueConnection qc = null;
        QueueSession qs = null;
        try {
            qc = queueConnectionFactory().createQueueConnection();
            qs = qc.createQueueSession (true, 0);
            QueueSender snd = qs.createSender (channelInQueue());
            snd.setDisableMessageID (true);
            snd.setDisableMessageTimestamp (true);
            ObjectMessage msg = qs.createObjectMessage((Serializable)message);
            String processKey = ((Long)ctx.getPrimaryKey()).toString();
            msg.setStringProperty ("processKey", processKey);
View Full Code Here

            String receivedCount = sqsMessage.getAttribute().get(
                    MessageBoxConstants.SQS_MESSAGE_ATTRIBUTE_RECEIVE_COUNT);
            textMessage.setStringProperty(MessageBoxConstants.JMS_MESSAGE_PROPERTY_RECEIVED_COUNT,
                                          (receivedCount != null) ? receivedCount : "0");

            queueSender = queueSession.createSender(queue);
            queueSender.send(textMessage);


        } catch (QueueConnectionManagerException e) {
            throw new JMSQueueHandlerException(e);
View Full Code Here

      cnn = factory.createQueueConnection();
      session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      TextMessage msg = session.createTextMessage("Hello World " + new Date());

      sender = session.createSender(queue);
      sender.send(msg);
      session.close();
      cnn.close();
     
      Thread.sleep(5 * 1000);
 
View Full Code Here

      cnn = factory.createQueueConnection();
      session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      msg = session.createTextMessage("Hello World " + new Date());

      sender = session.createSender(queue);
     
      sender.send(msg);
      session.close();
      cnn.close();
     
View Full Code Here

   
    //If we wanted a completely new message we would do something like
      //TextMessage msg = sess.createTextMessage();
    
    //Bounce the incoming message back out onto the queue     
    QueueSender sender = sess.createSender(queue);
    sender.send(msg);
   
    log.info("bounceback completed");
   }
  
View Full Code Here

         // create a JMS message.
         Message msg = session.createMessage();
         msg.setStringProperty("arg", "testMDBRunAs");
         msg.setJMSReplyTo(queB);
         // send the constructed message to queue A.
         QueueSender sender = session.createSender(queA);
         sender.send(msg);
         sender.close();
         log.debug("Sent msg to queue/QueueA");
         // receive the message at queue B.
         QueueReceiver recv = session.createReceiver(queB);
View Full Code Here

         // create a JMS message.
         Message msg = session.createMessage();
         msg.setStringProperty("arg", "testMDBDeepRunAs");
         msg.setJMSReplyTo(queB);
         // send the constructed message to queue D.
         QueueSender sender = session.createSender(queD);
         sender.send(msg);
         sender.close();
         log.debug("Sent msg to " + queD);
         // receive the message at queue B
         QueueReceiver recv = session.createReceiver(queB);
View Full Code Here

         // create a JMS message.
         Message msg = session.createMessage();
         msg.setStringProperty("name", "testRunAsWithRoles");
         msg.setJMSReplyTo(queB);
         // send the constructed message to queue C.
         QueueSender sender = session.createSender(queC);
         sender.send(msg);
         sender.close();
         log.debug("Sent msg to queue/QueueC");
         // receive the message at queue B.
         QueueReceiver recv = session.createReceiver(queB);
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.