Search in sources :

Example 1 with QueueWireTapInput

use of com.swiftmq.impl.streams.comp.io.QueueWireTapInput in project swiftmq-ce by iitsoftware.

the class StreamProcessor method visit.

@Override
public void visit(POWireTapMessage po) {
    if (ctx.ctx.traceSpace.enabled)
        ctx.ctx.traceSpace.trace(ctx.ctx.streamsSwiftlet.getName(), toString() + "/visit, po=" + po + " ...");
    po.setSuccess(true);
    msgsProcessed++;
    try {
        QueueWireTapInput input = po.getWireTapInput();
        Message message = po.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();
    } 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 : Message(com.swiftmq.impl.streams.comp.message.Message) QueueWireTapInput(com.swiftmq.impl.streams.comp.io.QueueWireTapInput)

Aggregations

QueueWireTapInput (com.swiftmq.impl.streams.comp.io.QueueWireTapInput)1 Message (com.swiftmq.impl.streams.comp.message.Message)1