Search in sources :

Example 6 with StreamProcessorController

use of io.zeebe.logstreams.processor.StreamProcessorController in project zeebe by zeebe-io.

the class WorkflowQueueManagerService method installWorkflowStreamProcessor.

private void installWorkflowStreamProcessor(final LogStream logStream) {
    final ServiceName<StreamProcessorController> streamProcessorServiceName = workflowInstanceStreamProcessorServiceName(logStream.getLogName());
    final String streamProcessorName = streamProcessorServiceName.getName();
    final ServerTransport transport = clientApiTransportInjector.getValue();
    final CommandResponseWriter responseWriter = new CommandResponseWriter(transport.getOutput());
    final ServiceName<LogStream> logStreamServiceName = logStreamServiceName(logStream.getLogName());
    final ServerTransport managementServer = managementServerInjector.getValue();
    final CreateWorkflowResponseSender createWorkflowResponseSender = new CreateWorkflowResponseSender(managementServer);
    final WorkflowInstanceStreamProcessor workflowInstanceStreamProcessor = new WorkflowInstanceStreamProcessor(responseWriter, createWorkflowResponseSender, workflowCfg.deploymentCacheSize, workflowCfg.payloadCacheSize);
    final StreamProcessorService workflowStreamProcessorService = new StreamProcessorService(streamProcessorName, StreamProcessorIds.WORKFLOW_INSTANCE_PROCESSOR_ID, workflowInstanceStreamProcessor).eventFilter(WorkflowInstanceStreamProcessor.eventFilter());
    serviceContext.createService(streamProcessorServiceName, workflowStreamProcessorService).dependency(logStreamServiceName, workflowStreamProcessorService.getLogStreamInjector()).dependency(SNAPSHOT_STORAGE_SERVICE, workflowStreamProcessorService.getSnapshotStorageInjector()).install();
}
Also used : CommandResponseWriter(io.zeebe.broker.transport.clientapi.CommandResponseWriter) ServerTransport(io.zeebe.transport.ServerTransport) StreamProcessorController(io.zeebe.logstreams.processor.StreamProcessorController) LogStream(io.zeebe.logstreams.log.LogStream) WorkflowInstanceStreamProcessor(io.zeebe.broker.workflow.processor.WorkflowInstanceStreamProcessor) CreateWorkflowResponseSender(io.zeebe.broker.system.deployment.handler.CreateWorkflowResponseSender) StreamProcessorService(io.zeebe.broker.logstreams.processor.StreamProcessorService)

Example 7 with StreamProcessorController

use of io.zeebe.logstreams.processor.StreamProcessorController in project zeebe by zeebe-io.

the class TaskQueueManagerService method startExpireLockService.

protected void startExpireLockService(ServiceName<LogStream> logStreamServiceName, LogStream stream, TypedStreamEnvironment env) {
    final ServiceName<StreamProcessorController> expireLockStreamProcessorServiceName = taskQueueExpireLockStreamProcessorServiceName(stream.getLogName());
    final TaskExpireLockStreamProcessor expireLockStreamProcessor = new TaskExpireLockStreamProcessor(env.buildStreamReader(), env.buildStreamWriter());
    final TypedStreamProcessor streamProcessor = expireLockStreamProcessor.createStreamProcessor(env);
    final StreamProcessorService expireLockStreamProcessorService = new StreamProcessorService(expireLockStreamProcessorServiceName.getName(), TASK_EXPIRE_LOCK_STREAM_PROCESSOR_ID, streamProcessor).eventFilter(streamProcessor.buildTypeFilter());
    serviceContext.createService(expireLockStreamProcessorServiceName, expireLockStreamProcessorService).dependency(logStreamServiceName, expireLockStreamProcessorService.getLogStreamInjector()).dependency(SNAPSHOT_STORAGE_SERVICE, expireLockStreamProcessorService.getSnapshotStorageInjector()).install();
}
Also used : StreamProcessorController(io.zeebe.logstreams.processor.StreamProcessorController) TypedStreamProcessor(io.zeebe.broker.logstreams.processor.TypedStreamProcessor) StreamProcessorService(io.zeebe.broker.logstreams.processor.StreamProcessorService) TaskExpireLockStreamProcessor(io.zeebe.broker.task.processor.TaskExpireLockStreamProcessor)

Aggregations

StreamProcessorController (io.zeebe.logstreams.processor.StreamProcessorController)7 StreamProcessorService (io.zeebe.broker.logstreams.processor.StreamProcessorService)5 TypedStreamProcessor (io.zeebe.broker.logstreams.processor.TypedStreamProcessor)4 TypedStreamEnvironment (io.zeebe.broker.logstreams.processor.TypedStreamEnvironment)3 LogStream (io.zeebe.logstreams.log.LogStream)3 ServerTransport (io.zeebe.transport.ServerTransport)3 BufferUtil.bufferAsString (io.zeebe.util.buffer.BufferUtil.bufferAsString)2 Broker (io.zeebe.broker.Broker)1 IncidentStreamProcessor (io.zeebe.broker.incident.processor.IncidentStreamProcessor)1 CreateWorkflowResponseSender (io.zeebe.broker.system.deployment.handler.CreateWorkflowResponseSender)1 TaskExpireLockStreamProcessor (io.zeebe.broker.task.processor.TaskExpireLockStreamProcessor)1 TaskInstanceStreamProcessor (io.zeebe.broker.task.processor.TaskInstanceStreamProcessor)1 CommandResponseWriter (io.zeebe.broker.transport.clientapi.CommandResponseWriter)1 WorkflowInstanceStreamProcessor (io.zeebe.broker.workflow.processor.WorkflowInstanceStreamProcessor)1 Raft (io.zeebe.raft.Raft)1 ServiceContainer (io.zeebe.servicecontainer.ServiceContainer)1 Test (org.junit.Test)1