Package javax.jms

Examples of javax.jms.QueueSession.createMessage()


         // Step 11. Start the Connection to allow the queue requestor to receive replies
         connection.start();

         // Step 12. Create a JMS message which is used to send a management message
         Message m = session.createMessage();

         // Step 13. Use a helper class to fill the JMS message with management information:
         // * the name of the resource to manage
         // * in this case, we want to retrieve the value of the messageCount of the queue
         JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "messageCount");
View Full Code Here


         // Step 15. Use a helper class to retrieve the operation result
         int messageCount = (Integer)JMSManagementHelper.getResult(reply);
         System.out.println(queue.getQueueName() + " contains " + messageCount + " messages");

         // Step 16. Create another JMS message to use as a management message
         m = session.createMessage();

         // Step 17. Use a helper class to fill the JMS message with management information:
         // * the object name of the resource to manage (i.e. the queue)
         // * in this case, we want to call the "removeMessage" operation with the JMS MessageID
         // of the message sent to the queue in step 8.
View Full Code Here

            /*
             * Send a non-text control message indicating end of
             * messages.
             */
            queueSender.send(queueSession.createMessage());
        }
        catch (JMSException e) {
            System.out.println("Exception occurred: " +
                    e.toString());
        }
View Full Code Here

            /*
             * Send a non-text control message indicating end of
             * messages.
             */
            queueSender.send(queueSession.createMessage());
        }
        catch (JMSException e) {
            System.out.println("Exception occurred: " +
                    e.toString());
        }
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.