use of com.wavefront.agent.listeners.ChannelByteArrayHandler in project java by wavefrontHQ.
the class PushAgent method startPickleListener.
protected void startPickleListener(String strPort, ReportableEntityHandlerFactory handlerFactory, GraphiteFormatter formatter) {
if (tokenAuthenticator.authRequired()) {
logger.warning("Port: " + strPort + " (pickle format) is not compatible with HTTP authentication, ignoring");
return;
}
int port = Integer.parseInt(strPort);
registerPrefixFilter(strPort);
registerTimestampFilter(strPort);
// Set up a custom handler
ChannelHandler channelHandler = new ChannelByteArrayHandler(new PickleProtocolDecoder("unknown", proxyConfig.getCustomSourceTags(), formatter.getMetricMangler(), port), handlerFactory.getHandler(HandlerKey.of(ReportableEntityType.POINT, strPort)), preprocessors.get(strPort), blockedPointsLogger);
startAsManagedThread(port, new TcpIngester(createInitializer(ImmutableList.of(() -> new LengthFieldBasedFrameDecoder(ByteOrder.BIG_ENDIAN, 1000000, 0, 4, 0, 4, false), ByteArrayDecoder::new, () -> channelHandler), port, proxyConfig.getListenerIdleConnectionTimeout(), getSslContext(strPort)), port).withChildChannelOptions(childChannelOptions), "listener-binary-pickle-" + strPort);
logger.info("listening on port: " + strPort + " for Graphite/pickle protocol metrics");
}
Aggregations