@Override public int getMaxBodySize() { return MAX_BODY_SIZE_PROP.get(); }
@Override public int perServerWaterline() { return PER_SERVER_WATERLINE.get(); }
public PushConnection(PushProtocol pushProtocol, ChannelHandlerContext ctx) { this.pushProtocol = pushProtocol; this.ctx = ctx; tkBktAllowance = TOKEN_BUCKET_RATE.get(); tkBktLastCheckTime = System.currentTimeMillis(); }
@Override public int perServerWaterline() { return PER_SERVER_WATERLINE.get(); }
@VisibleForTesting boolean isRightSizeForGzip(HttpResponseMessage response) { final Integer bodySize = HttpUtils.getBodySizeIfKnown(response); //bodySize == null is chunked encoding which is eligible for gzip compression return (bodySize == null) || (bodySize.intValue() >= MIN_BODY_SIZE_FOR_GZIP.get()); }
@Override public int getMaxRequestsPerConnection() { return MAX_REQUESTS_PER_CONNECTION.get(); }
public PushConnection(PushProtocol pushProtocol, ChannelHandlerContext ctx) { this.pushProtocol = pushProtocol; this.ctx = ctx; tkBktAllowance = TOKEN_BUCKET_RATE.get(); tkBktLastCheckTime = System.currentTimeMillis(); }
private void closeIfNotAuthenticated() { if (! isAuthenticated()) { logger.error("Closing connection because it is still unauthenticated after {} seconds.", UNAUTHENTICATED_CONN_TTL.get()); forceCloseConnectionFromServerSide(); } }
@Override public void incrementConcurrency() throws ZuulFilterConcurrencyExceededException { final int limit = filterConcurrencyLimit.get(); if ((concurrencyProtectEnabled.get()) && (concurrentCount.get() >= limit)) { concurrencyRejections.increment(); throw new ZuulFilterConcurrencyExceededException(this, limit); } concurrentCount.incrementAndGet(); }
private void requestClientToCloseConnection() { if (ctx.channel().isActive()) { // Application level protocol for asking client to close connection ctx.writeAndFlush(pushProtocol.goAwayMessage()); // Force close connection if client doesn't close in reasonable time after we made request ctx.executor().schedule(() -> forceCloseConnectionFromServerSide(), CLIENT_CLOSE_GRACE_PERIOD.get(), TimeUnit.SECONDS); } else { forceCloseConnectionFromServerSide(); } }
@Override public void preRequestChecks(HttpRequestMessage zuulRequest) { if (concurrencyProtectionEnabled.get() && concurrentRequests.get() > concurrencyMax.get()) { rejectedRequests.increment(); throw new OriginConcurrencyExceededException(getName()); } concurrentRequests.incrementAndGet(); }
@VisibleForTesting boolean isRightSizeForGzip(HttpResponseMessage response) { final Integer bodySize = HttpUtils.getBodySizeIfKnown(response); //bodySize == null is chunked encoding which is eligible for gzip compression return (bodySize == null) || (bodySize.intValue() >= MIN_BODY_SIZE_FOR_GZIP.get()); }
private void closeIfNotAuthenticated() { if (! isAuthenticated()) { logger.error("Closing connection because it is still unauthenticated after {} seconds.", UNAUTHENTICATED_CONN_TTL.get()); forceCloseConnectionFromServerSide(); } }
@Override public void incrementConcurrency() throws ZuulFilterConcurrencyExceededException { final int limit = filterConcurrencyLimit.get(); if ((concurrencyProtectEnabled.get()) && (concurrentCount.get() >= limit)) { concurrencyRejections.increment(); throw new ZuulFilterConcurrencyExceededException(this, limit); } concurrentCount.incrementAndGet(); }
private void requestClientToCloseConnection() { if (ctx.channel().isActive()) { // Application level protocol for asking client to close connection ctx.writeAndFlush(pushProtocol.goAwayMessage()); // Force close connection if client doesn't close in reasonable time after we made request ctx.executor().schedule(() -> forceCloseConnectionFromServerSide(), CLIENT_CLOSE_GRACE_PERIOD.get(), TimeUnit.SECONDS); } else { forceCloseConnectionFromServerSide(); } }
@Override public void preRequestChecks(HttpRequestMessage zuulRequest) { if (concurrencyProtectionEnabled.get() && concurrentRequests.get() > concurrencyMax.get()) { rejectedRequests.increment(); throw new OriginConcurrencyExceededException(getName()); } concurrentRequests.incrementAndGet(); }