From 6bf144551f794a82fb794e8acded6a11e448ce7a Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Wed, 11 Sep 2019 15:47:42 -0400 Subject: [PATCH] Moves createPending up the chain a bit --- .../cloud/gateway/rsocket/core/GatewayRSocket.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-cloud-gateway-rsocket/spring-cloud-gateway-rsocket-broker/src/main/java/org/springframework/cloud/gateway/rsocket/core/GatewayRSocket.java b/spring-cloud-gateway-rsocket/spring-cloud-gateway-rsocket-broker/src/main/java/org/springframework/cloud/gateway/rsocket/core/GatewayRSocket.java index 8ccad6f5..3588677f 100644 --- a/spring-cloud-gateway-rsocket/spring-cloud-gateway-rsocket-broker/src/main/java/org/springframework/cloud/gateway/rsocket/core/GatewayRSocket.java +++ b/spring-cloud-gateway-rsocket/spring-cloud-gateway-rsocket-broker/src/main/java/org/springframework/cloud/gateway/rsocket/core/GatewayRSocket.java @@ -144,7 +144,7 @@ public class GatewayRSocket extends AbstractGatewayRSocket { // put route in exchange for later use exchange.getAttributes().put(ROUTE_ATTR, route); return findRSocketOrCreatePending(exchange, route); - }); + }).switchIfEmpty(createPending(exchange)); // TODO: deal with connecting to cluster? } @@ -165,8 +165,7 @@ public class GatewayRSocket extends AbstractGatewayRSocket { log.debug("Found RSocket: " + rSocket); } return rSocket; - }).log(GatewayRSocket.class.getName() + ".find rsocket", Level.FINEST) - .switchIfEmpty(createPending(exchange)); + }).log(GatewayRSocket.class.getName() + ".find rsocket", Level.FINEST); } protected Mono createPending(GatewayExchange exchange) {