public static <I, O> RxServer<I, O> createTcpServer(final int port, PipelineConfigurator<I, O> pipelineConfigurator, ConnectionHandler<I, O> connectionHandler) { return newTcpServerBuilder(port, connectionHandler).pipelineConfigurator(pipelineConfigurator).build(); }
public static <I, O> RxServer<I, O> createTcpServer(final int port, PipelineConfigurator<I, O> pipelineConfigurator, ConnectionHandler<I, O> connectionHandler) { return newTcpServerBuilder(port, connectionHandler).pipelineConfigurator(pipelineConfigurator).build(); }
@PostConstruct public void start() { server = RxNetty.newTcpServerBuilder(serverPort, tcpHandlerProvider.get()) .pipelineConfigurator(pipelineConfigurator) .withMetricEventsListenerFactory(servoEventsListenerFactory) .build() // .withErrorHandler() TODO use a custom handler (?) as the default emits extraneous error logs .start(); logger.info("Starting {} on port {} with {} encoding...", getClass().getSimpleName(), server.getServerPort(), config.getCodec()); }
/** * Creates a new {@link KaryonServer} that has a single TCP server instance which delegates all connection * handling to {@link ConnectionHandler}. * The {@link RxServer} is created using {@link RxNetty#newTcpServerBuilder(int, ConnectionHandler)} * * @param port Port for the server. * @param handler Connection Handler * @param bootstrapModules Additional bootstrapModules if any. * * @return {@link KaryonServer} which is to be used to start the created server. */ public static KaryonServer forTcpConnectionHandler(int port, ConnectionHandler<ByteBuf, ByteBuf> handler, BootstrapModule... bootstrapModules) { RxServer<ByteBuf, ByteBuf> server = RxNetty.newTcpServerBuilder(port, handler).build(); return new RxNettyServerBackedServer(server, bootstrapModules); }
/** * Creates a new {@link KaryonServer} that has a single TCP server instance which delegates all connection * handling to {@link ConnectionHandler}. * The {@link RxServer} is created using {@link RxNetty#newTcpServerBuilder(int, ConnectionHandler)} * * @param port Port for the server. * @param handler Connection Handler * @param suites Additional suites if any. * * @return {@link KaryonServer} which is to be used to start the created server. */ public static KaryonServer forTcpConnectionHandler(int port, ConnectionHandler<ByteBuf, ByteBuf> handler, LifecycleInjectorBuilderSuite... suites) { RxServer<ByteBuf, ByteBuf> server = RxNetty.newTcpServerBuilder(port, handler).build(); return new RxNettyServerBackedServer(server, suites); }
/** * Creates a new {@link KaryonServer} that has a single TCP server instance which delegates all connection * handling to {@link ConnectionHandler}. * The {@link RxServer} is created using {@link RxNetty#newTcpServerBuilder(int, ConnectionHandler)} * * @param port Port for the server. * @param handler Connection Handler * @param bootstrapModules Additional bootstrapModules if any. * * @return {@link KaryonServer} which is to be used to start the created server. */ public static KaryonServer forTcpConnectionHandler(int port, ConnectionHandler<ByteBuf, ByteBuf> handler, BootstrapModule... bootstrapModules) { RxServer<ByteBuf, ByteBuf> server = RxNetty.newTcpServerBuilder(port, handler).build(); return new RxNettyServerBackedServer(server, bootstrapModules); }
@Inject public void setInjector(Injector injector) { ServerConfig config = injector.getInstance(serverConfigKey); ConnectionHandler<I, O> connectionHandler = injector.getInstance(connectionHandlerKey); ServerBuilder<I, O> builder = RxNetty.newTcpServerBuilder(config.getPort(), connectionHandler); if (injector.getExistingBinding(pipelineConfiguratorKey) != null) { builder.appendPipelineConfigurator(injector.getInstance(pipelineConfiguratorKey)); } if (injector.getExistingBinding(metricEventsListenerFactoryKey) != null) { builder.withMetricEventsListenerFactory(injector.getInstance(metricEventsListenerFactoryKey)); } server = builder.build().start(); logger.info("Starting server {} on port {}...", nameAnnotation.value(), server.getServerPort()); } }
@Inject public void setInjector(Injector injector) { ServerConfig config = injector.getInstance(serverConfigKey); ConnectionHandler<I, O> connectionHandler = injector.getInstance(connectionHandlerKey); ServerBuilder<I, O> builder = RxNetty.newTcpServerBuilder(config.getPort(), connectionHandler); if (injector.getExistingBinding(pipelineConfiguratorKey) != null) { builder.appendPipelineConfigurator(injector.getInstance(pipelineConfiguratorKey)); } if (injector.getExistingBinding(metricEventsListenerFactoryKey) != null) { builder.withMetricEventsListenerFactory(injector.getInstance(metricEventsListenerFactoryKey)); } server = builder.build().start(); logger.info("Starting server {} on port {}...", nameAnnotation.value(), server.getServerPort()); } }
@Inject public void setInjector(Injector injector) { ServerConfig config = injector.getInstance(serverConfigKey); ConnectionHandler<I, O> connectionHandler = injector.getInstance(connectionHandlerKey); ServerBuilder<I, O> builder = RxNetty.newTcpServerBuilder(config.getPort(), connectionHandler); if (injector.getExistingBinding(pipelineConfiguratorKey) != null) { builder.appendPipelineConfigurator(injector.getInstance(pipelineConfiguratorKey)); } if (injector.getExistingBinding(metricEventsListenerFactoryKey) != null) { builder.withMetricEventsListenerFactory(injector.getInstance(metricEventsListenerFactoryKey)); } server = builder.build().start(); logger.info("Starting server {} on port {}...", nameAnnotation.value(), server.getServerPort()); } }
@PostConstruct public void start() { server = RxNetty.newTcpServerBuilder( config.getRegistrationPort(), new TcpRegistrationHandler(eurekaRegistry, evictionQueue, metricFactory)) .pipelineConfigurator(EurekaTransports.registrationPipeline(config.getCodec())) .withMetricEventsListenerFactory(servoEventsListenerFactory) .build() .start(); logger.info("Starting TCP registration server on port {} with {} encoding...", server.getServerPort(), config.getCodec()); } }
@PostConstruct public void start() { server = RxNetty.newTcpServerBuilder( config.getDiscoveryPort(), new TcpDiscoveryHandler(eurekaRegistry, metricFactory)) .pipelineConfigurator(EurekaTransports.discoveryPipeline(config.getCodec())) .withMetricEventsListenerFactory(servoEventsListenerFactory) .build() .start(); logger.info("Starting TCP discovery server on port {} with {} encoding...", server.getServerPort(), config.getCodec()); } }
@PostConstruct public void start() { server = RxNetty.newTcpServerBuilder( config.getReplicationPort(), new TcpReplicationHandler(selfRegistrationService, eurekaRegistry, evictionQueue, metricFactory)) .pipelineConfigurator(EurekaTransports.replicationPipeline(config.getCodec())) .withMetricEventsListenerFactory(servoEventsListenerFactory) .build() .start(); logger.info("Starting TCP replication server on port {} with {} encoding...", server.getServerPort(), config.getCodec()); }