Search in sources :

Example 1 with ChannelByteArrayHandler

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");
}
Also used : ChannelByteArrayHandler(com.wavefront.agent.listeners.ChannelByteArrayHandler) PickleProtocolDecoder(com.wavefront.ingester.PickleProtocolDecoder) ChannelHandler(io.netty.channel.ChannelHandler) LengthFieldBasedFrameDecoder(io.netty.handler.codec.LengthFieldBasedFrameDecoder) ReportPoint(wavefront.report.ReportPoint) TcpIngester(com.wavefront.ingester.TcpIngester) ByteArrayDecoder(io.netty.handler.codec.bytes.ByteArrayDecoder)

Aggregations

ChannelByteArrayHandler (com.wavefront.agent.listeners.ChannelByteArrayHandler)1 PickleProtocolDecoder (com.wavefront.ingester.PickleProtocolDecoder)1 TcpIngester (com.wavefront.ingester.TcpIngester)1 ChannelHandler (io.netty.channel.ChannelHandler)1 LengthFieldBasedFrameDecoder (io.netty.handler.codec.LengthFieldBasedFrameDecoder)1 ByteArrayDecoder (io.netty.handler.codec.bytes.ByteArrayDecoder)1 ReportPoint (wavefront.report.ReportPoint)1