protected void addHttp2StreamSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("h2_metrics_inbound", http2MetricsChannelHandlers.inbound()); pipeline.addLast("h2_metrics_outbound", http2MetricsChannelHandlers.outbound()); pipeline.addLast("h2_max_requests_per_conn", connectionExpiryHandler); pipeline.addLast("h2_conn_close", connectionCloseHandler); pipeline.addLast(http2ResetFrameHandler); pipeline.addLast("h2_downgrader", new Http2StreamFrameToHttpObjectCodec(true)); pipeline.addLast(http2StreamErrorHandler); pipeline.addLast(http2StreamHeaderCleaner); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { if (msg instanceof Http2Frame) { incrementCounter(registry, frameCounterName, metricId, (Http2Frame) msg); } } finally { super.channelRead(ctx, msg); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { try { if (cause instanceof Http2Exception) { incrementErrorCounter(registry, errorCounterName, metricId, (Http2Exception) cause); } } finally { super.exceptionCaught(ctx, cause); } } }
addSslClientCertChecks(pipeline); Http2MetricsChannelHandlers http2MetricsChannelHandlers = new Http2MetricsChannelHandlers(registry,"server", "http2-" + port); Http2ConnectionCloseHandler connectionCloseHandler = new Http2ConnectionCloseHandler(channelConfig.get(CommonChannelConfigKeys.connCloseDelay), registry); Http2ConnectionExpiryHandler connectionExpiryHandler = new Http2ConnectionExpiryHandler(maxRequestsPerConnection, maxRequestsPerConnectionInBrownout, connectionExpiry);
addSslClientCertChecks(pipeline); Http2MetricsChannelHandlers http2MetricsChannelHandlers = new Http2MetricsChannelHandlers(registry,"server", "http2-" + port); Http2ConnectionCloseHandler connectionCloseHandler = new Http2ConnectionCloseHandler(channelConfig.get(CommonChannelConfigKeys.connCloseDelay), registry); Http2ConnectionExpiryHandler connectionExpiryHandler = new Http2ConnectionExpiryHandler(maxRequestsPerConnection, maxRequestsPerConnectionInBrownout, connectionExpiry);
protected void addHttp2StreamSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("h2_metrics_inbound", http2MetricsChannelHandlers.inbound()); pipeline.addLast("h2_metrics_outbound", http2MetricsChannelHandlers.outbound()); pipeline.addLast("h2_max_requests_per_conn", connectionExpiryHandler); pipeline.addLast("h2_conn_close", connectionCloseHandler); pipeline.addLast(http2ResetFrameHandler); pipeline.addLast("h2_downgrader", new Http2StreamFrameToHttpObjectCodec(true)); pipeline.addLast(http2StreamErrorHandler); pipeline.addLast(http2StreamHeaderCleaner); }
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { super.write(ctx, msg, promise); if (msg instanceof Http2Frame) { incrementCounter(registry, frameCounterName, metricId, (Http2Frame) msg); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { try { if (cause instanceof Http2Exception) { incrementErrorCounter(registry, errorCounterName, metricId, (Http2Exception) cause); } } finally { super.exceptionCaught(ctx, cause); } } }
addSslClientCertChecks(pipeline); Http2MetricsChannelHandlers http2MetricsChannelHandlers = new Http2MetricsChannelHandlers(registry,"server", "http2-" + port); Http2ConnectionCloseHandler connectionCloseHandler = new Http2ConnectionCloseHandler(channelConfig.get(CommonChannelConfigKeys.connCloseDelay), registry); Http2ConnectionExpiryHandler connectionExpiryHandler = new Http2ConnectionExpiryHandler(maxRequestsPerConnection, maxRequestsPerConnectionInBrownout, connectionExpiry);
protected void addHttp2StreamSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("h2_metrics_inbound", http2MetricsChannelHandlers.inbound()); pipeline.addLast("h2_metrics_outbound", http2MetricsChannelHandlers.outbound()); pipeline.addLast("h2_max_requests_per_conn", connectionExpiryHandler); pipeline.addLast("h2_conn_close", connectionCloseHandler); pipeline.addLast(http2ResetFrameHandler); pipeline.addLast("h2_downgrader", new Http2StreamFrameToHttpObjectCodec(true)); pipeline.addLast(http2StreamErrorHandler); pipeline.addLast(http2StreamHeaderCleaner); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { if (msg instanceof Http2Frame) { incrementCounter(registry, frameCounterName, metricId, (Http2Frame) msg); } } finally { super.channelRead(ctx, msg); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { try { if (cause instanceof Http2Exception) { incrementErrorCounter(registry, errorCounterName, metricId, (Http2Exception) cause); } } finally { super.exceptionCaught(ctx, cause); } } }
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { super.write(ctx, msg, promise); if (msg instanceof Http2Frame) { incrementCounter(registry, frameCounterName, metricId, (Http2Frame) msg); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { try { if (cause instanceof Http2Exception) { incrementErrorCounter(registry, errorCounterName, metricId, (Http2Exception) cause); } } finally { super.exceptionCaught(ctx, cause); } } }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { if (msg instanceof Http2Frame) { incrementCounter(registry, frameCounterName, metricId, (Http2Frame) msg); } } finally { super.channelRead(ctx, msg); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { try { if (cause instanceof Http2Exception) { incrementErrorCounter(registry, errorCounterName, metricId, (Http2Exception) cause); } } finally { super.exceptionCaught(ctx, cause); } } }
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { super.write(ctx, msg, promise); if (msg instanceof Http2Frame) { incrementCounter(registry, frameCounterName, metricId, (Http2Frame) msg); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { try { if (cause instanceof Http2Exception) { incrementErrorCounter(registry, errorCounterName, metricId, (Http2Exception) cause); } } finally { super.exceptionCaught(ctx, cause); } } }