Search in sources :

Example 1 with Dispatcher

use of io.zeebe.dispatcher.Dispatcher in project zeebe by zeebe-io.

the class BufferingServerTransportService method start.

@Override
public void start(ServiceStartContext serviceContext) {
    final ActorScheduler scheduler = serviceContext.getScheduler();
    final Dispatcher receiveBuffer = receiveBufferInjector.getValue();
    final Dispatcher sendBuffer = sendBufferInjector.getValue();
    serverTransport = Transports.newServerTransport().name(readableName).bindAddress(bindAddress).sendBuffer(sendBuffer).scheduler(scheduler).buildBuffering(receiveBuffer);
    LOG.info("Bound {} to {}", readableName, bindAddress);
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) Dispatcher(io.zeebe.dispatcher.Dispatcher)

Example 2 with Dispatcher

use of io.zeebe.dispatcher.Dispatcher 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 3 with Dispatcher

use of io.zeebe.dispatcher.Dispatcher in project zeebe by zeebe-io.

the class ClientTransportService method start.

@Override
public void start(ServiceStartContext startContext) {
    final Dispatcher sendBuffer = sendBufferInjector.getValue();
    final ActorScheduler scheduler = startContext.getScheduler();
    final ClientTransportBuilder transportBuilder = Transports.newClientTransport();
    transport = transportBuilder.sendBuffer(sendBuffer).requestPoolSize(requestPoolSize).scheduler(scheduler).build();
    if (defaultEndpoints != null) {
        // make transport open and manage channels to the default endpoints
        defaultEndpoints.forEach(s -> transport.registerRemoteAddress(s));
    }
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) Dispatcher(io.zeebe.dispatcher.Dispatcher)

Example 4 with Dispatcher

use of io.zeebe.dispatcher.Dispatcher in project zeebe by zeebe-io.

the class ServerTransportService method start.

@Override
public void start(ServiceStartContext serviceContext) {
    final ActorScheduler scheduler = serviceContext.getScheduler();
    final Dispatcher sendBuffer = sendBufferInjector.getValue();
    final ServerRequestHandler requestHandler = requestHandlerInjector.getValue();
    final ServerMessageHandler messageHandler = messageHandlerInjector.getValue();
    serverTransport = Transports.newServerTransport().name(readableName).bindAddress(bindAddress).sendBuffer(sendBuffer).scheduler(scheduler).build(messageHandler, requestHandler);
    LOG.info("Bound {} to {}", readableName, bindAddress);
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) Dispatcher(io.zeebe.dispatcher.Dispatcher)

Example 5 with Dispatcher

use of io.zeebe.dispatcher.Dispatcher in project zeebe by zeebe-io.

the class ClientApiMessageHandlerService method start.

@Override
public void start(ServiceStartContext startContext) {
    final Dispatcher controlMessageBuffer = controlMessageBufferInjector.getValue();
    service = new ClientApiMessageHandler(controlMessageBuffer);
}
Also used : Dispatcher(io.zeebe.dispatcher.Dispatcher)

Aggregations

Dispatcher (io.zeebe.dispatcher.Dispatcher)5 ActorScheduler (io.zeebe.util.sched.ActorScheduler)4 RequestTopologyHandler (io.zeebe.broker.clustering.handler.RequestTopologyHandler)1 RemoveTopicSubscriptionHandler (io.zeebe.broker.event.handler.RemoveTopicSubscriptionHandler)1 TopicSubscriptionService (io.zeebe.broker.event.processor.TopicSubscriptionService)1 RequestPartitionsMessageHandler (io.zeebe.broker.system.log.RequestPartitionsMessageHandler)1 SystemPartitionManager (io.zeebe.broker.system.log.SystemPartitionManager)1 TaskSubscriptionManager (io.zeebe.broker.task.TaskSubscriptionManager)1 ServerOutput (io.zeebe.transport.ServerOutput)1 ServerTransport (io.zeebe.transport.ServerTransport)1