Search in sources :

Example 1 with OutboundTransformer

use of com.swiftmq.impl.amqp.amqp.v01_00_00.transformer.OutboundTransformer in project swiftmq-ce by iitsoftware.

the class SourceMessageProcessor method transformMessage.

private Delivery transformMessage(MessageEntry messageEntry) throws JMSException {
    try {
        MessageImpl message = sourceLink.isQueue ? messageEntry.getMessage() : copyMessage(messageEntry.getMessage());
        MessageIndex messageIndex = messageEntry.getMessageIndex();
        OutboundTransformer transformer = sourceLink.getTransformer();
        if (ctx.traceSpace.enabled)
            ctx.traceSpace.trace(ctx.amqpSwiftlet.getName(), toString() + "/transformMessage, transformer=" + transformer);
        if (transformer == null)
            throw new JMSException("No outbound message transformer found!");
        Delivery delivery = new Delivery(sourceLink, message, messageIndex);
        transformer.transform(delivery);
        return delivery;
    } catch (Exception e) {
        e.printStackTrace();
        throw new JMSException(e.toString());
    }
}
Also used : MessageIndex(com.swiftmq.swiftlet.queue.MessageIndex) OutboundTransformer(com.swiftmq.impl.amqp.amqp.v01_00_00.transformer.OutboundTransformer) JMSException(javax.jms.JMSException) MessageImpl(com.swiftmq.jms.MessageImpl) JMSException(javax.jms.JMSException)

Aggregations

OutboundTransformer (com.swiftmq.impl.amqp.amqp.v01_00_00.transformer.OutboundTransformer)1 MessageImpl (com.swiftmq.jms.MessageImpl)1 MessageIndex (com.swiftmq.swiftlet.queue.MessageIndex)1 JMSException (javax.jms.JMSException)1