Example usage for org.springframework.jms.support QosSettings getPriority

List of usage examples for org.springframework.jms.support QosSettings getPriority

Introduction

In this page you can find the example usage for org.springframework.jms.support QosSettings getPriority.

Prototype

public int getPriority() 

Source Link

Document

Return the priority of a message when sending.

Usage

From source file:org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener.java

/**
 * Send the given response message to the given destination.
 * @param response the JMS message to send
 * @param destination the JMS destination to send to
 * @param session the JMS session to operate on
 * @throws JMSException if thrown by JMS API methods
 * @see #postProcessProducer//from  w w w .  ja v a2s .  c o  m
 * @see javax.jms.Session#createProducer
 * @see javax.jms.MessageProducer#send
 */
protected void sendResponse(Session session, Destination destination, Message response) throws JMSException {
    MessageProducer producer = session.createProducer(destination);
    try {
        postProcessProducer(producer, response);
        QosSettings settings = getResponseQosSettings();
        if (settings != null) {
            producer.send(response, settings.getDeliveryMode(), settings.getPriority(),
                    settings.getTimeToLive());
        } else {
            producer.send(response);
        }
    } finally {
        JmsUtils.closeMessageProducer(producer);
    }
}