Search in sources :

Example 1 with QueueMessageProcessor

use of com.swiftmq.impl.streams.processor.QueueMessageProcessor in project swiftmq-ce by iitsoftware.

the class QueueInput method start.

@Override
public void start() throws Exception {
    if (started)
        return;
    MessageSelector ms = null;
    if (selector != null) {
        ms = new MessageSelector(selector);
        ms.compile();
    }
    QueueReceiver receiver = ctx.ctx.queueManager.createQueueReceiver(destinationName, (ActiveLogin) null, ms);
    messageProcessor = new QueueMessageProcessor(ctx, this, receiver, ms);
    messageProcessor.restart();
    started = true;
}
Also used : QueueReceiver(com.swiftmq.swiftlet.queue.QueueReceiver) MessageSelector(com.swiftmq.ms.MessageSelector) QueueMessageProcessor(com.swiftmq.impl.streams.processor.QueueMessageProcessor)

Example 2 with QueueMessageProcessor

use of com.swiftmq.impl.streams.processor.QueueMessageProcessor in project swiftmq-ce by iitsoftware.

the class TopicInput method start.

@Override
public void start() throws Exception {
    if (started)
        return;
    if (!ctx.ctx.topicManager.isTopicDefined(destinationName))
        ctx.ctx.topicManager.createTopic(destinationName);
    MessageSelector ms = null;
    if (selector != null) {
        ms = new MessageSelector(selector);
        ms.compile();
    }
    if (durable) {
        ActiveLogin dlogin = ctx.ctx.authenticationSwiftlet.createActiveLogin(clientId, "DURABLE");
        dlogin.setClientId(clientId);
        TopicImpl topic = ctx.ctx.topicManager.verifyTopic(new TopicImpl(destinationName));
        queueName = ctx.ctx.topicManager.subscribeDurable(durableName, topic, ms, false, dlogin);
    } else {
        queueName = ctx.ctx.queueManager.createTemporaryQueue();
        subscriberId = ctx.ctx.topicManager.subscribe(destinationName, ms, false, queueName, true);
    }
    QueueReceiver receiver = ctx.ctx.queueManager.createQueueReceiver(queueName, (ActiveLogin) null, null);
    messageProcessor = new QueueMessageProcessor(ctx, this, receiver, null);
    messageProcessor.restart();
    started = true;
}
Also used : ActiveLogin(com.swiftmq.swiftlet.auth.ActiveLogin) QueueReceiver(com.swiftmq.swiftlet.queue.QueueReceiver) MessageSelector(com.swiftmq.ms.MessageSelector) TopicImpl(com.swiftmq.jms.TopicImpl) QueueMessageProcessor(com.swiftmq.impl.streams.processor.QueueMessageProcessor)

Aggregations

QueueMessageProcessor (com.swiftmq.impl.streams.processor.QueueMessageProcessor)2 MessageSelector (com.swiftmq.ms.MessageSelector)2 QueueReceiver (com.swiftmq.swiftlet.queue.QueueReceiver)2 TopicImpl (com.swiftmq.jms.TopicImpl)1 ActiveLogin (com.swiftmq.swiftlet.auth.ActiveLogin)1