Example usage for javax.jms QueueSession toString

List of usage examples for javax.jms QueueSession toString

Introduction

In this page you can find the example usage for javax.jms QueueSession toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.panksdmz.jms.tibco.MessageSenderBean.java

public void send() {
    try {/*from  w  ww . j  av  a2  s . c  o  m*/
        QueueConnection connection = connectionFactory.createQueueConnection();
        QueueSession session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
        Queue queue = session.createQueue(sendQueueName);
        QueueSender sender = session.createSender(queue);
        TextMessage message = session
                .createTextMessage("Message @ " + CaliHDateTime.now().getTimeInMillis() + " from thread "
                        + Thread.currentThread().getId() + " from session [" + session.toString() + "]");

        sender.send(message);
        session.close();

    } catch (JMSException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}