@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { // read message and track if it was keepAlive if (msg instanceof HttpRequest) { final HttpRequest request = (HttpRequest) msg; if (persistentConnection) { pendingResponses += 1; persistentConnection = isKeepAlive(request); } } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { inPackets.incrementAndGet(); if (msg instanceof ByteBuf) { inSize.addAndGet(((ByteBuf) msg).readableBytes()); } else if (msg instanceof DatagramPacket) { inSize.addAndGet(((DatagramPacket) msg).content().readableBytes()); } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { log(ctx, false, msg); super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (!(msg instanceof HttpRequest)) { ctx.fireChannelRead(msg); return; } String uri = ((HttpRequest) msg).uri(); if ("/unsampled".equals(uri)) { ctx.channel().attr(URI_ATTRIBUTE).set(uri); unsampled.channelRead(ctx, msg); } else if ("/traced".equals(uri)) { ctx.channel().attr(URI_ATTRIBUTE).set(uri); traced.channelRead(ctx, msg); } else if ("/tracedextra".equals(uri)) { ctx.channel().attr(URI_ATTRIBUTE).set(uri); ExtraFieldPropagation.set("country-code", "FO"); tracedExtra.channelRead(ctx, msg); } else if ("/traced128".equals(uri)) { ctx.channel().attr(URI_ATTRIBUTE).set(uri); traced128.channelRead(ctx, msg); } else { ctx.fireChannelRead(msg); } }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof Http2HeadersFrame) { onHeadersRead(ctx, (Http2HeadersFrame) msg); } else if (msg instanceof Http2DataFrame) { onDataRead(ctx, (Http2DataFrame) msg); } else { super.channelRead(ctx, msg); } }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { if (ByteBuf.class.isAssignableFrom(msg.getClass())) { publishBytesRead((ByteBuf) msg); } else if (ByteBufHolder.class.isAssignableFrom(msg.getClass())) { ByteBufHolder holder = (ByteBufHolder) msg; publishBytesRead(holder.content()); } } catch (Exception e) { logger.warn("Failed to publish bytes read metrics event. This does *not* stop the pipeline processing.", e); } finally { super.channelRead(ctx, msg); } }
super.channelRead(ctx, msg);
super.channelRead(ctx, msg);
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { super.channelRead(ctx, msg); } catch (Exception e) { log.error("Uncaught exception on connection " + connectionName, e); throw e; } }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { // read message and track if it was keepAlive if (msg instanceof HttpRequest) { final HttpRequest request = (HttpRequest) msg; if (persistentConnection) { pendingResponses += 1; persistentConnection = isKeepAlive(request); } } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { // read message and track if it was keepAlive if (msg instanceof HttpRequest) { final HttpRequest request = (HttpRequest) msg; if (persistentConnection) { pendingResponses += 1; persistentConnection = isKeepAlive(request); } } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { // read message and track if it was keepAlive if (msg instanceof HttpRequest) { final HttpRequest request = (HttpRequest) msg; if (persistentConnection) { pendingResponses += 1; persistentConnection = isKeepAlive(request); } } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { // read message and track if it was keepAlive if (msg instanceof HttpRequest) { final HttpRequest request = (HttpRequest) msg; if (persistentConnection) { pendingResponses += 1; persistentConnection = isKeepAlive(request); } } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { decoder.channelRead(ctx, msg); super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof ByteBuf) { receivedBytesCount.inc(((ByteBuf) msg).readableBytes()); } else if (msg instanceof ByteBufHolder) { receivedBytesCount.inc(((ByteBufHolder) msg).content().readableBytes()); } else { LOGGER.warn(format("channelRead(): Expected byte buffers, but got [%s]", msg)); } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof ClientResourceResponseImpl) { ResourceRequest inReplyTo = ((ClientResourceResponseImpl) msg).inReplyTo(); Consumer<ClientResourceResponse> handler = this.handlers.remove(inReplyTo.requestId()); if (handler != null) { this.executor.execute(() -> handler.accept((ClientResourceResponse) msg)); } } else { super.channelRead(ctx, msg); } }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpContent && !this.firstChunkReceived) { timeToFirstByteListener.notifyTimeToFirstByte(clock.tickMillis() - startTimeMs, MILLISECONDS); firstChunkReceived = true; } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpContent && !this.firstChunkReceived) { timeToFirstByteListener.notifyTimeToFirstByte(clock.tickMillis() - startTimeMs, MILLISECONDS); firstChunkReceived = true; } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { CorfuMsg corfuMsg = (CorfuMsg) msg; List<CorfuMsg> transformedByFilters = applyFilters(corfuMsg); log.info("Applied {} filtering rule(s) on the inbound message. " + "Message id:{} and Message type:{}", handlingFilters.size(), corfuMsg.getRequestID(), corfuMsg.getMsgType()); for (CorfuMsg aCorfuMsg : transformedByFilters) { super.channelRead(ctx, aCorfuMsg); } }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpResponse) { // just make sure we can combine the request and response together HttpResponse response = (HttpResponse)msg; NettyHttpClientRequest request = sendedQueue.poll(); request.setResponse(response); // calling the callback here request.getCxfResponseCallback().responseReceived(response); } else { super.channelRead(ctx, msg); } }