use of org.graylog2.inputs.transports.netty.ExceptionLoggingChannelHandler in project graylog2-server by Graylog2.
the class AbstractTcpTransport method getChildChannelHandlers.
@Override
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getChildChannelHandlers(MessageInput input) {
final LinkedHashMap<String, Callable<? extends ChannelHandler>> handlers = new LinkedHashMap<>();
final CodecAggregator aggregator = getAggregator();
handlers.put("channel-registration", () -> new ChannelRegistrationHandler(childChannels));
handlers.put("traffic-counter", () -> throughputCounter);
handlers.put("connection-counter", () -> connectionCounter);
if (tlsEnable) {
LOG.info("Enabled TLS for input [{}/{}]. key-file=\"{}\" cert-file=\"{}\"", input.getName(), input.getId(), tlsKeyFile, tlsCertFile);
handlers.put("tls", getSslHandlerCallable(input));
}
handlers.putAll(getCustomChildChannelHandlers(input));
if (aggregator != null) {
LOG.debug("Adding codec aggregator {} to channel pipeline", aggregator);
handlers.put("codec-aggregator", () -> new ByteBufMessageAggregationHandler(aggregator, localRegistry));
}
handlers.put("rawmessage-handler", () -> new RawMessageHandler(input));
handlers.put("exception-logger", () -> new ExceptionLoggingChannelHandler(input, LOG, this.tcpKeepalive));
return handlers;
}
use of org.graylog2.inputs.transports.netty.ExceptionLoggingChannelHandler in project graylog2-server by Graylog2.
the class NettyTransport method getChannelHandlers.
/**
* Subclasses can override this to add additional {@link ChannelHandler channel handlers} to the
* Netty {@link ChannelPipeline} to support additional features.
*
* Some common use cases are to add connection counters or traffic shapers.
*
* @param input The {@link MessageInput} for which these channel handlers are being added
* @return list of initial {@link ChannelHandler channel handlers} to add to the Netty {@link ChannelPipeline channel pipeline}
*/
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getChannelHandlers(final MessageInput input) {
LinkedHashMap<String, Callable<? extends ChannelHandler>> handlerList = new LinkedHashMap<>();
handlerList.put("exception-logger", () -> new ExceptionLoggingChannelHandler(input, log));
handlerList.put("packet-meta-dumper", () -> new PacketInformationDumper(input));
handlerList.put("output-failure-logger", () -> PromiseFailureHandler.INSTANCE);
return handlerList;
}
Aggregations