use of com.hotels.styx.server.netty.ServerConnector in project styx by ExpediaGroup.
the class StyxServer method httpServer.
private InetServer httpServer(StyxServerComponents components, ConnectorConfig connectorConfig, HttpHandler styxDataPlane) {
Environment environment = components.environment();
CharSequence styxInfoHeaderName = environment.configuration().styxHeaderConfig().styxInfoHeaderName();
ResponseInfoFormat responseInfoFormat = new ResponseInfoFormat(environment);
ServerConnector proxyConnector = new ProxyConnectorFactory(environment.configuration().proxyServerConfig(), environment.centralisedMetrics(), environment.errorListener(), environment.configuration().get(ENCODE_UNWISECHARS).orElse(""), (builder, request) -> builder.header(styxInfoHeaderName, responseInfoFormat.format(request)), environment.configuration().get("requestTracking", Boolean.class).orElse(false), environment.httpMessageFormatter(), environment.configuration().styxHeaderConfig().originIdHeaderName()).create(connectorConfig);
return NettyServerBuilder.newBuilder().setMetricsRegistry(environment.metricRegistry()).bossExecutor(proxyBossExecutor).workerExecutor(proxyWorkerExecutor).setProtocolConnector(proxyConnector).handler(styxDataPlane).build();
}
Aggregations