From 8f84147f37501ba4d8822f21e6a5c7a41bc80d68 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Sun, 26 Apr 2020 21:30:37 +0200 Subject: [PATCH] Fix deprecations after Reactor Netty upgrade --- .../boot/rsocket/netty/NettyRSocketServerFactory.java | 4 ++-- .../web/embedded/netty/NettyReactiveWebServerFactory.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java index 9a2bbae9c8..98ff89ceb4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java @@ -138,7 +138,7 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur private ServerTransport createWebSocketTransport() { if (this.resourceFactory != null) { HttpServer httpServer = HttpServer.create().tcpConfiguration((tcpServer) -> tcpServer - .runOn(this.resourceFactory.getLoopResources()).addressSupplier(this::getListenAddress)); + .runOn(this.resourceFactory.getLoopResources()).bindAddress(this::getListenAddress)); return WebsocketServerTransport.create(httpServer); } return WebsocketServerTransport.create(getListenAddress()); @@ -147,7 +147,7 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur private ServerTransport createTcpTransport() { if (this.resourceFactory != null) { TcpServer tcpServer = TcpServer.create().runOn(this.resourceFactory.getLoopResources()) - .addressSupplier(this::getListenAddress); + .bindAddress(this::getListenAddress); return TcpServerTransport.create(tcpServer); } return TcpServerTransport.create(getListenAddress()); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java index 0bc774f026..9b0b759be3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java @@ -155,11 +155,11 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact if (this.resourceFactory != null) { LoopResources resources = this.resourceFactory.getLoopResources(); Assert.notNull(resources, "No LoopResources: is ReactorResourceFactory not initialized yet?"); - server = server.tcpConfiguration( - (tcpServer) -> tcpServer.runOn(resources).addressSupplier(this::getListenAddress)); + server = server + .tcpConfiguration((tcpServer) -> tcpServer.runOn(resources).bindAddress(this::getListenAddress)); } else { - server = server.tcpConfiguration((tcpServer) -> tcpServer.addressSupplier(this::getListenAddress)); + server = server.tcpConfiguration((tcpServer) -> tcpServer.bindAddress(this::getListenAddress)); } if (getSsl() != null && getSsl().isEnabled()) { SslServerCustomizer sslServerCustomizer = new SslServerCustomizer(getSsl(), getHttp2(),