Search in sources :

Example 21 with Message

use of com.swiftmq.impl.streams.comp.message.Message in project swiftmq-ce by iitsoftware.

the class StreamProcessor method visit.

@Override
public void visit(POMessage po) {
    if (ctx.ctx.traceSpace.enabled)
        ctx.ctx.traceSpace.trace(ctx.ctx.streamsSwiftlet.getName(), toString() + "/visit, po=" + po + " ...");
    po.setSuccess(true);
    msgsProcessed++;
    try {
        QueueMessageProcessor messageProcessor = po.getMessageProcessor();
        if (messageProcessor.isValid()) {
            ctx.addTransaction(messageProcessor.getTransaction(), null);
            Input input = messageProcessor.getInput();
            Message message = ctx.messageBuilder.wrap(messageProcessor.getMessage());
            input.current(message).executeCallback();
            if (message.isOnMessageEnabled()) {
                long start = System.nanoTime();
                ctx.stream.current(input.current()).executeOnMessageCallback();
                timeOnMessage = (int) (System.nanoTime() - start) / 1000;
            }
            ctx.commitTransactions();
            messageProcessor.restart();
        }
    } catch (Exception e) {
        handleException(po, e);
    }
    if (po.getSemaphore() != null)
        po.getSemaphore().notifySingleWaiter();
    if (ctx.ctx.traceSpace.enabled)
        ctx.ctx.traceSpace.trace(ctx.ctx.streamsSwiftlet.getName(), toString() + "/visit, po=" + po + " done");
}
Also used : Input(com.swiftmq.impl.streams.comp.io.Input) QueueWireTapInput(com.swiftmq.impl.streams.comp.io.QueueWireTapInput) ManagementInput(com.swiftmq.impl.streams.comp.io.ManagementInput) Message(com.swiftmq.impl.streams.comp.message.Message)

Aggregations

Message (com.swiftmq.impl.streams.comp.message.Message)21 Property (com.swiftmq.impl.streams.comp.message.Property)4 POMgmtMessage (com.swiftmq.impl.streams.processor.po.POMgmtMessage)3 ManagementInput (com.swiftmq.impl.streams.comp.io.ManagementInput)2 QueueWireTapInput (com.swiftmq.impl.streams.comp.io.QueueWireTapInput)2 MessageSelector (com.swiftmq.ms.MessageSelector)2 Input (com.swiftmq.impl.streams.comp.io.Input)1 HeapMemory (com.swiftmq.impl.streams.comp.memory.HeapMemory)1 Memory (com.swiftmq.impl.streams.comp.memory.Memory)1 MessageImpl (com.swiftmq.jms.MessageImpl)1 QueueImpl (com.swiftmq.jms.QueueImpl)1 BigDecimal (java.math.BigDecimal)1 ResultSet (java.sql.ResultSet)1 ResultSetMetaData (java.sql.ResultSetMetaData)1 Statement (java.sql.Statement)1