Search in sources :

Example 1 with TaskInstanceStreamProcessor

use of io.zeebe.broker.task.processor.TaskInstanceStreamProcessor in project zeebe by zeebe-io.

the class TaskQueueManagerService method startTaskQueue.

@Override
public void startTaskQueue(ServiceName<LogStream> logStreamServiceName, final LogStream stream) {
    final ServiceName<StreamProcessorController> streamProcessorServiceName = taskQueueInstanceStreamProcessorServiceName(stream.getLogName());
    final String streamProcessorName = streamProcessorServiceName.getName();
    final ServerTransport serverTransport = clientApiTransportInjector.getValue();
    final TaskSubscriptionManager taskSubscriptionManager = taskSubscriptionManagerInjector.getValue();
    final TaskInstanceStreamProcessor taskInstanceStreamProcessor = new TaskInstanceStreamProcessor(taskSubscriptionManager);
    final TypedStreamEnvironment env = new TypedStreamEnvironment(stream, serverTransport.getOutput());
    final TypedStreamProcessor streamProcessor = taskInstanceStreamProcessor.createStreamProcessor(env);
    final StreamProcessorService taskInstanceStreamProcessorService = new StreamProcessorService(streamProcessorName, TASK_QUEUE_STREAM_PROCESSOR_ID, streamProcessor).eventFilter(streamProcessor.buildTypeFilter());
    serviceContext.createService(streamProcessorServiceName, taskInstanceStreamProcessorService).group(TASK_QUEUE_STREAM_PROCESSOR_SERVICE_GROUP_NAME).dependency(logStreamServiceName, taskInstanceStreamProcessorService.getLogStreamInjector()).dependency(SNAPSHOT_STORAGE_SERVICE, taskInstanceStreamProcessorService.getSnapshotStorageInjector()).install();
    startExpireLockService(logStreamServiceName, stream, env);
}
Also used : ServerTransport(io.zeebe.transport.ServerTransport) TaskInstanceStreamProcessor(io.zeebe.broker.task.processor.TaskInstanceStreamProcessor) StreamProcessorController(io.zeebe.logstreams.processor.StreamProcessorController) TypedStreamEnvironment(io.zeebe.broker.logstreams.processor.TypedStreamEnvironment) TypedStreamProcessor(io.zeebe.broker.logstreams.processor.TypedStreamProcessor) StreamProcessorService(io.zeebe.broker.logstreams.processor.StreamProcessorService)

Aggregations

StreamProcessorService (io.zeebe.broker.logstreams.processor.StreamProcessorService)1 TypedStreamEnvironment (io.zeebe.broker.logstreams.processor.TypedStreamEnvironment)1 TypedStreamProcessor (io.zeebe.broker.logstreams.processor.TypedStreamProcessor)1 TaskInstanceStreamProcessor (io.zeebe.broker.task.processor.TaskInstanceStreamProcessor)1 StreamProcessorController (io.zeebe.logstreams.processor.StreamProcessorController)1 ServerTransport (io.zeebe.transport.ServerTransport)1