Search in sources :

Example 1 with IFSAServerQueueSender

use of com.ing.ifsa.IFSAServerQueueSender in project iaf by ibissource.

the class IfsaFacade method sendReply.

/**
 * Intended for server-side reponse sending and implies that the received
 * message *always* contains a reply-to address.
 */
public void sendReply(QueueSession session, Message received_message, String response) throws IfsaException {
    QueueSender tqs = null;
    try {
        TextMessage answer = session.createTextMessage();
        answer.setText(response);
        Queue replyQueue = (Queue) received_message.getJMSReplyTo();
        tqs = session.createSender(replyQueue);
        if (log.isDebugEnabled())
            log.debug(getLogPrefix() + "sending reply to [" + received_message.getJMSReplyTo() + "]");
        ((IFSAServerQueueSender) tqs).sendReply(received_message, answer);
    } catch (Throwable t) {
        throw new IfsaException(t);
    } finally {
        if (tqs != null) {
            try {
                tqs.close();
            } catch (JMSException e) {
                log.warn(getLogPrefix() + "exception closing reply queue sender", e);
            }
        }
    }
}
Also used : IfsaException(nl.nn.adapterframework.extensions.ifsa.IfsaException) IFSAServerQueueSender(com.ing.ifsa.IFSAServerQueueSender) IFSAQueueSender(com.ing.ifsa.IFSAQueueSender) QueueSender(javax.jms.QueueSender) JMSException(javax.jms.JMSException) IFSAServerQueueSender(com.ing.ifsa.IFSAServerQueueSender) IFSAQueue(com.ing.ifsa.IFSAQueue) Queue(javax.jms.Queue) IFSATextMessage(com.ing.ifsa.IFSATextMessage) TextMessage(javax.jms.TextMessage)

Aggregations

IFSAQueue (com.ing.ifsa.IFSAQueue)1 IFSAQueueSender (com.ing.ifsa.IFSAQueueSender)1 IFSAServerQueueSender (com.ing.ifsa.IFSAServerQueueSender)1 IFSATextMessage (com.ing.ifsa.IFSATextMessage)1 JMSException (javax.jms.JMSException)1 Queue (javax.jms.Queue)1 QueueSender (javax.jms.QueueSender)1 TextMessage (javax.jms.TextMessage)1 IfsaException (nl.nn.adapterframework.extensions.ifsa.IfsaException)1