use of org.graylog2.inputs.transports.netty.HttpHandler in project graylog2-server by Graylog2.
the class HttpTransport method getCustomChildChannelHandlers.
@Override
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getCustomChildChannelHandlers(MessageInput input) {
final LinkedHashMap<String, Callable<? extends ChannelHandler>> handlers = new LinkedHashMap<>();
if (idleWriterTimeout > 0) {
// Install read timeout handler to close idle connections after a timeout.
// This avoids dangling HTTP connections when the HTTP client does not close the connection properly.
// For details see: https://github.com/Graylog2/graylog2-server/issues/3223#issuecomment-270350500
handlers.put("read-timeout-handler", () -> new ReadTimeoutHandler(idleWriterTimeout, TimeUnit.SECONDS));
}
handlers.put("decoder", () -> new HttpRequestDecoder(DEFAULT_MAX_INITIAL_LINE_LENGTH, DEFAULT_MAX_HEADER_SIZE, maxChunkSize));
handlers.put("decompressor", HttpContentDecompressor::new);
handlers.put("encoder", HttpResponseEncoder::new);
handlers.put("aggregator", () -> new HttpObjectAggregator(maxChunkSize));
handlers.put("http-handler", () -> new HttpHandler(enableCors));
handlers.putAll(super.getCustomChildChannelHandlers(input));
return handlers;
}
Aggregations