Browse Source

removes Flux|Mono.log() calls

fixes gh-93
pull/96/head
Spencer Gibb 7 years ago
parent
commit
64cf2678bd
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 2
      spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/WebClientHttpRoutingFilter.java
  2. 8
      spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/WebsocketRoutingFilter.java
  3. 4
      spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java
  4. 2
      spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMapping.java

2
spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/WebClientHttpRoutingFilter.java

@ -84,7 +84,7 @@ public class WebClientHttpRoutingFilter implements GlobalFilter, Ordered { @@ -84,7 +84,7 @@ public class WebClientHttpRoutingFilter implements GlobalFilter, Ordered {
}
return headersSpec.exchange()
.log("webClient route")
// .log("webClient route")
.flatMap(res -> {
ServerHttpResponse response = exchange.getResponse();
response.getHeaders().putAll(res.headers().asHttpHeaders());

8
spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/WebsocketRoutingFilter.java

@ -99,11 +99,11 @@ public class WebsocketRoutingFilter implements GlobalFilter, Ordered { @@ -99,11 +99,11 @@ public class WebsocketRoutingFilter implements GlobalFilter, Ordered {
public Mono<Void> handle(WebSocketSession proxySession) {
// Use retain() for Reactor Netty
Mono<Void> proxySessionSend = proxySession
.send(session.receive().doOnNext(WebSocketMessage::retain))
.log("proxySessionSend", Level.FINE);
.send(session.receive().doOnNext(WebSocketMessage::retain));
// .log("proxySessionSend", Level.FINE);
Mono<Void> serverSessionSend = session
.send(proxySession.receive().doOnNext(WebSocketMessage::retain))
.log("sessionSend", Level.FINE);
.send(proxySession.receive().doOnNext(WebSocketMessage::retain));
// .log("sessionSend", Level.FINE);
return Mono.when(proxySessionSend, serverSessionSend).then();
}

4
spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java

@ -57,8 +57,8 @@ public class RedisRateLimiter implements RateLimiter { @@ -57,8 +57,8 @@ public class RedisRateLimiter implements RateLimiter {
List<String> args = Arrays.asList(replenishRate + "", burstCapacity + "",
Instant.now().getEpochSecond() + "", "1");
// allowed, tokens_left = redis.eval(SCRIPT, keys, args)
Flux<List<Long>> flux = this.redisTemplate.execute(this.script, keys, args)
.log("redisratelimiter", Level.FINER);
Flux<List<Long>> flux = this.redisTemplate.execute(this.script, keys, args);
// .log("redisratelimiter", Level.FINER);
return flux.onErrorResume(throwable -> Flux.just(Arrays.asList(1L, -1L)))
.reduce(new ArrayList<Long>(), (longs, l) -> {
longs.addAll(l);

2
spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMapping.java

@ -50,7 +50,7 @@ public class RoutePredicateHandlerMapping extends AbstractHandlerMapping { @@ -50,7 +50,7 @@ public class RoutePredicateHandlerMapping extends AbstractHandlerMapping {
exchange.getAttributes().put(GATEWAY_HANDLER_MAPPER_ATTR, getClass().getSimpleName());
return lookupRoute(exchange)
.log("route-predicate-handler-mapping", Level.FINER) //name this
// .log("route-predicate-handler-mapping", Level.FINER) //name this
.flatMap((Function<Route, Mono<?>>) r -> {
if (logger.isDebugEnabled()) {
logger.debug("Mapping [" + getExchangeDesc(exchange) + "] to " + r);

Loading…
Cancel
Save