Search in sources :

Example 1 with ServerTransport

use of io.zeebe.transport.ServerTransport in project zeebe by zeebe-io.

the class ControlMessageHandlerManagerService method start.

@Override
public void start(ServiceStartContext context) {
    final Dispatcher controlMessageBuffer = controlMessageBufferInjector.getValue();
    final ServerTransport transport = transportInjector.getValue();
    final ActorScheduler actorScheduler = context.getScheduler();
    final TaskSubscriptionManager taskSubscriptionManager = taskSubscriptionManagerInjector.getValue();
    final TopicSubscriptionService topicSubscriptionService = topicSubscriptionServiceInjector.getValue();
    final SystemPartitionManager systemPartitionManager = systemPartitionManagerInjector.getValue();
    final ServerOutput output = transport.getOutput();
    final List<ControlMessageHandler> controlMessageHandlers = Arrays.asList(new AddTaskSubscriptionHandler(output, taskSubscriptionManager), new IncreaseTaskSubscriptionCreditsHandler(output, taskSubscriptionManager), new RemoveTaskSubscriptionHandler(output, taskSubscriptionManager), new RemoveTopicSubscriptionHandler(output, topicSubscriptionService), new RequestTopologyHandler(output, clusterManagerInjector.getValue()), new RequestPartitionsMessageHandler(output, systemPartitionManager));
    service = new ControlMessageHandlerManager(transport.getOutput(), controlMessageBuffer, controlMessageRequestTimeoutInMillis, actorScheduler, controlMessageHandlers);
    context.async(service.openAsync());
}
Also used : ServerOutput(io.zeebe.transport.ServerOutput) ServerTransport(io.zeebe.transport.ServerTransport) TopicSubscriptionService(io.zeebe.broker.event.processor.TopicSubscriptionService) RemoveTopicSubscriptionHandler(io.zeebe.broker.event.handler.RemoveTopicSubscriptionHandler) SystemPartitionManager(io.zeebe.broker.system.log.SystemPartitionManager) Dispatcher(io.zeebe.dispatcher.Dispatcher) TaskSubscriptionManager(io.zeebe.broker.task.TaskSubscriptionManager) RequestPartitionsMessageHandler(io.zeebe.broker.system.log.RequestPartitionsMessageHandler) RequestTopologyHandler(io.zeebe.broker.clustering.handler.RequestTopologyHandler) ActorScheduler(io.zeebe.util.sched.ActorScheduler)

Example 2 with ServerTransport

use of io.zeebe.transport.ServerTransport 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)

Example 3 with ServerTransport

use of io.zeebe.transport.ServerTransport in project zeebe by zeebe-io.

the class TaskSubscriptionManagerService method start.

@Override
public void start(ServiceStartContext startContext) {
    final ServerTransport clientApiTransport = transportInjector.getValue();
    final ActorScheduler actorScheduler = startContext.getScheduler();
    service = new TaskSubscriptionManager(startContext, clientApiTransport);
    actorScheduler.submitActor(service);
    final ActorFuture<Void> transportRegistration = clientApiTransport.registerChannelListener(service);
    startContext.async(transportRegistration);
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) ServerTransport(io.zeebe.transport.ServerTransport)

Example 4 with ServerTransport

use of io.zeebe.transport.ServerTransport in project zeebe by zeebe-io.

the class WorkflowQueueManagerService method installIncidentStreamProcessor.

private void installIncidentStreamProcessor(final LogStream logStream) {
    final ServiceName<StreamProcessorController> streamProcessorServiceName = incidentStreamProcessorServiceName(logStream.getLogName());
    final String streamProcessorName = streamProcessorServiceName.getName();
    final ServerTransport transport = clientApiTransportInjector.getValue();
    final ServiceName<LogStream> logStreamServiceName = logStreamServiceName(logStream.getLogName());
    final TypedStreamEnvironment env = new TypedStreamEnvironment(logStream, transport.getOutput());
    final IncidentStreamProcessor incidentProcessorFactory = new IncidentStreamProcessor();
    final TypedStreamProcessor streamProcessor = incidentProcessorFactory.createStreamProcessor(env);
    final StreamProcessorService incidentStreamProcessorService = new StreamProcessorService(streamProcessorName, INCIDENT_PROCESSOR_ID, streamProcessor).eventFilter(streamProcessor.buildTypeFilter());
    serviceContext.createService(streamProcessorServiceName, incidentStreamProcessorService).dependency(logStreamServiceName, incidentStreamProcessorService.getLogStreamInjector()).dependency(SNAPSHOT_STORAGE_SERVICE, incidentStreamProcessorService.getSnapshotStorageInjector()).install();
}
Also used : ServerTransport(io.zeebe.transport.ServerTransport) IncidentStreamProcessor(io.zeebe.broker.incident.processor.IncidentStreamProcessor) StreamProcessorController(io.zeebe.logstreams.processor.StreamProcessorController) LogStream(io.zeebe.logstreams.log.LogStream) TypedStreamEnvironment(io.zeebe.broker.logstreams.processor.TypedStreamEnvironment) TypedStreamProcessor(io.zeebe.broker.logstreams.processor.TypedStreamProcessor) StreamProcessorService(io.zeebe.broker.logstreams.processor.StreamProcessorService)

Example 5 with ServerTransport

use of io.zeebe.transport.ServerTransport 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)

Aggregations

ServerTransport (io.zeebe.transport.ServerTransport)6 StreamProcessorService (io.zeebe.broker.logstreams.processor.StreamProcessorService)3 StreamProcessorController (io.zeebe.logstreams.processor.StreamProcessorController)3 TypedStreamEnvironment (io.zeebe.broker.logstreams.processor.TypedStreamEnvironment)2 TypedStreamProcessor (io.zeebe.broker.logstreams.processor.TypedStreamProcessor)2 LogStream (io.zeebe.logstreams.log.LogStream)2 ActorScheduler (io.zeebe.util.sched.ActorScheduler)2 RequestTopologyHandler (io.zeebe.broker.clustering.handler.RequestTopologyHandler)1 RemoveTopicSubscriptionHandler (io.zeebe.broker.event.handler.RemoveTopicSubscriptionHandler)1 TopicSubscriptionService (io.zeebe.broker.event.processor.TopicSubscriptionService)1 IncidentStreamProcessor (io.zeebe.broker.incident.processor.IncidentStreamProcessor)1 CreateWorkflowResponseSender (io.zeebe.broker.system.deployment.handler.CreateWorkflowResponseSender)1 RequestPartitionsMessageHandler (io.zeebe.broker.system.log.RequestPartitionsMessageHandler)1 SystemPartitionManager (io.zeebe.broker.system.log.SystemPartitionManager)1 TaskSubscriptionManager (io.zeebe.broker.task.TaskSubscriptionManager)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 TopicSubscription (io.zeebe.client.event.TopicSubscription)1 Dispatcher (io.zeebe.dispatcher.Dispatcher)1