@Override public void init(final SystemContext context) { createSocketBindings(context); createClientTransports(context); }
protected ServiceName<Dispatcher> createReceiveBuffer( final ServiceContainer serviceContainer, final String transportName, final ByteValue bufferSize) { final ServiceName<Dispatcher> serviceName = TransportServiceNames.receiveBufferName(transportName); createDispatcher(serviceContainer, serviceName, bufferSize); return serviceName; }
bindNonBufferingProtocolEndpoint( context, serviceContainer, bindBufferingProtocolEndpoint( context, serviceContainer, bindBufferingProtocolEndpoint( context, serviceContainer, bindNonBufferingProtocolEndpoint( context, serviceContainer, createReceiveBuffer( serviceContainer, CLIENT_API_SERVER_NAME,
protected void start() { LOG.info("Version: {}", VERSION); LOG.info("Starting broker with configuration {}", getConfig().toJson()); brokerContext.addComponent(new SystemComponent()); brokerContext.addComponent(new TransportComponent()); brokerContext.addComponent(new LogStreamsComponent()); brokerContext.addComponent(new SubscriptionComponent()); brokerContext.addComponent(new ClusterComponent()); brokerContext.addComponent(new GatewayComponent()); brokerContext.addComponent(new ExporterComponent()); brokerContext.init(); }
protected ActorFuture<BufferingServerTransport> bindBufferingProtocolEndpoint( final SystemContext systemContext, final ServiceContainer serviceContainer, final String name, final SocketBindingCfg socketBindingCfg, final ByteValue receiveBufferSize) { final SocketAddress bindAddr = socketBindingCfg.toSocketAddress(); return createBufferingServerTransport( systemContext, serviceContainer, name, bindAddr.toInetSocketAddress(), new ByteValue(socketBindingCfg.getSendBufferSize()), receiveBufferSize); }
protected ActorFuture<BufferingServerTransport> createBufferingServerTransport( final SystemContext systemContext, final ServiceContainer serviceContainer, final String name, final InetSocketAddress bindAddress, final ByteValue sendBufferSize, final ByteValue receiveBufferSize) { final ServiceName<Dispatcher> receiveBufferName = createReceiveBuffer(serviceContainer, name, receiveBufferSize); final BufferingServerTransportService service = new BufferingServerTransportService(name, bindAddress, sendBufferSize); systemContext.addResourceReleasingDelegate(service.getReleasingResourcesDelegate()); return serviceContainer .createService(TransportServiceNames.bufferingServerTransport(name), service) .dependency(receiveBufferName, service.getReceiveBufferInjector()) .install(); }
protected ActorFuture<ServerTransport> bindNonBufferingProtocolEndpoint( final SystemContext systemContext, final ServiceContainer serviceContainer, final String name, final SocketBindingCfg socketBindingCfg, final ServiceName<? extends ServerRequestHandler> requestHandlerService, final ServiceName<? extends ServerMessageHandler> messageHandlerService) { final SocketAddress bindAddr = socketBindingCfg.toSocketAddress(); return createServerTransport( systemContext, serviceContainer, name, bindAddr.toInetSocketAddress(), new ByteValue(socketBindingCfg.getSendBufferSize()), requestHandlerService, messageHandlerService); }
private void createClientTransports(final SystemContext context) { final ServiceContainer serviceContainer = context.getServiceContainer(); final BrokerCfg brokerCfg = context.getBrokerConfiguration(); final NetworkCfg networkCfg = brokerCfg.getNetwork(); final int nodeId = brokerCfg.getCluster().getNodeId(); final SocketAddress managementEndpoint = networkCfg.getManagement().toSocketAddress(); final SocketAddress subscriptionEndpoint = networkCfg.getSubscription().toSocketAddress(); final ActorFuture<ClientTransport> managementClientFuture = createClientTransport( serviceContainer, MANAGEMENT_API_CLIENT_NAME, new ByteValue(networkCfg.getDefaultSendBufferSize()), Collections.singletonList(new IntTuple<>(nodeId, managementEndpoint))); context.addRequiredStartAction(managementClientFuture); final ActorFuture<ClientTransport> replicationClientFuture = createClientTransport( serviceContainer, REPLICATION_API_CLIENT_NAME, new ByteValue(networkCfg.getDefaultSendBufferSize()), null); context.addRequiredStartAction(replicationClientFuture); final ActorFuture<ClientTransport> subscriptionClientFuture = createClientTransport( serviceContainer, SUBSCRIPTION_API_CLIENT_NAME, new ByteValue(networkCfg.getDefaultSendBufferSize()), Collections.singletonList(new IntTuple<>(nodeId, subscriptionEndpoint))); context.addRequiredStartAction(subscriptionClientFuture); }
bindNonBufferingProtocolEndpoint( context, serviceContainer, bindBufferingProtocolEndpoint( context, serviceContainer, bindBufferingProtocolEndpoint( context, serviceContainer, bindNonBufferingProtocolEndpoint( context, serviceContainer, createReceiveBuffer( serviceContainer, CLIENT_API_SERVER_NAME,
protected void start() { LOG.info("Version: {}", VERSION); LOG.info("Starting broker with configuration {}", getConfig().toJson()); brokerContext.addComponent(new SystemComponent()); brokerContext.addComponent(new TransportComponent()); brokerContext.addComponent(new LogStreamsComponent()); brokerContext.addComponent(new SubscriptionComponent()); brokerContext.addComponent(new ClusterComponent()); brokerContext.addComponent(new GatewayComponent()); brokerContext.addComponent(new ExporterComponent()); brokerContext.init(); }
protected ActorFuture<BufferingServerTransport> bindBufferingProtocolEndpoint( final SystemContext systemContext, final ServiceContainer serviceContainer, final String name, final SocketBindingCfg socketBindingCfg, final ByteValue receiveBufferSize) { final SocketAddress bindAddr = socketBindingCfg.toSocketAddress(); return createBufferingServerTransport( systemContext, serviceContainer, name, bindAddr.toInetSocketAddress(), new ByteValue(socketBindingCfg.getSendBufferSize()), receiveBufferSize); }
protected ActorFuture<BufferingServerTransport> createBufferingServerTransport( final SystemContext systemContext, final ServiceContainer serviceContainer, final String name, final InetSocketAddress bindAddress, final ByteValue sendBufferSize, final ByteValue receiveBufferSize) { final ServiceName<Dispatcher> receiveBufferName = createReceiveBuffer(serviceContainer, name, receiveBufferSize); final BufferingServerTransportService service = new BufferingServerTransportService(name, bindAddress, sendBufferSize); systemContext.addResourceReleasingDelegate(service.getReleasingResourcesDelegate()); return serviceContainer .createService(TransportServiceNames.bufferingServerTransport(name), service) .dependency(receiveBufferName, service.getReceiveBufferInjector()) .install(); }
protected ActorFuture<ServerTransport> bindNonBufferingProtocolEndpoint( final SystemContext systemContext, final ServiceContainer serviceContainer, final String name, final SocketBindingCfg socketBindingCfg, final ServiceName<? extends ServerRequestHandler> requestHandlerService, final ServiceName<? extends ServerMessageHandler> messageHandlerService) { final SocketAddress bindAddr = socketBindingCfg.toSocketAddress(); return createServerTransport( systemContext, serviceContainer, name, bindAddr.toInetSocketAddress(), new ByteValue(socketBindingCfg.getSendBufferSize()), requestHandlerService, messageHandlerService); }
private void createClientTransports(final SystemContext context) { final ServiceContainer serviceContainer = context.getServiceContainer(); final BrokerCfg brokerCfg = context.getBrokerConfiguration(); final NetworkCfg networkCfg = brokerCfg.getNetwork(); final int nodeId = brokerCfg.getCluster().getNodeId(); final SocketAddress managementEndpoint = networkCfg.getManagement().toSocketAddress(); final SocketAddress subscriptionEndpoint = networkCfg.getSubscription().toSocketAddress(); final ActorFuture<ClientTransport> managementClientFuture = createClientTransport( serviceContainer, MANAGEMENT_API_CLIENT_NAME, new ByteValue(networkCfg.getDefaultSendBufferSize()), Collections.singletonList(new IntTuple<>(nodeId, managementEndpoint))); context.addRequiredStartAction(managementClientFuture); final ActorFuture<ClientTransport> replicationClientFuture = createClientTransport( serviceContainer, REPLICATION_API_CLIENT_NAME, new ByteValue(networkCfg.getDefaultSendBufferSize()), null); context.addRequiredStartAction(replicationClientFuture); final ActorFuture<ClientTransport> subscriptionClientFuture = createClientTransport( serviceContainer, SUBSCRIPTION_API_CLIENT_NAME, new ByteValue(networkCfg.getDefaultSendBufferSize()), Collections.singletonList(new IntTuple<>(nodeId, subscriptionEndpoint))); context.addRequiredStartAction(subscriptionClientFuture); }
@Override public void init(final SystemContext context) { createSocketBindings(context); createClientTransports(context); }
protected ServiceName<Dispatcher> createReceiveBuffer( final ServiceContainer serviceContainer, final String transportName, final ByteValue bufferSize) { final ServiceName<Dispatcher> serviceName = TransportServiceNames.receiveBufferName(transportName); createDispatcher(serviceContainer, serviceName, bufferSize); return serviceName; }