diff --git a/spring-boot-admin-client/pom.xml b/spring-boot-admin-client/pom.xml
index f1d22012fa2..fb58c770b17 100644
--- a/spring-boot-admin-client/pom.xml
+++ b/spring-boot-admin-client/pom.xml
@@ -60,6 +60,11 @@
spring-webflux
true
+
+ io.projectreactor.netty
+ reactor-netty-http
+ true
+
org.projectlombok
lombok
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfiguration.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfiguration.java
index 31170899fe9..f4245343046 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfiguration.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfiguration.java
@@ -18,7 +18,10 @@
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.TimeUnit;
+import io.netty.channel.ChannelOption;
+import io.netty.handler.timeout.ReadTimeoutHandler;
import jakarta.servlet.ServletContext;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
@@ -42,8 +45,10 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
+import org.springframework.http.client.reactive.ReactorClientHttpConnector;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;
+import reactor.netty.http.client.HttpClient;
import de.codecentric.boot.admin.client.registration.ApplicationFactory;
import de.codecentric.boot.admin.client.registration.ApplicationRegistrator;
@@ -163,6 +168,12 @@ public RegistrationClient registrationClient(ClientProperties client, WebClient.
if (client.getUsername() != null && client.getPassword() != null) {
webClient = webClient.filter(basicAuthentication(client.getUsername(), client.getPassword()));
}
+ HttpClient httpClient = HttpClient.create()
+ .option(ChannelOption.CONNECT_TIMEOUT_MILLIS,
+ Long.valueOf(client.getConnectTimeout().toMillis()).intValue())
+ .doOnConnected(conn -> conn
+ .addHandlerLast(new ReadTimeoutHandler(client.getReadTimeout().toMillis(), TimeUnit.MILLISECONDS)));
+ webClient.clientConnector(new ReactorClientHttpConnector(httpClient));
return new ReactiveRegistrationClient(webClient.build(), client.getReadTimeout());
}
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/BlockingRegistrationClient.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/BlockingRegistrationClient.java
index 757a6a5c926..85fe7282d0a 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/BlockingRegistrationClient.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/BlockingRegistrationClient.java
@@ -18,6 +18,7 @@
import java.util.Collections;
import java.util.Map;
+import java.util.Optional;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
@@ -39,10 +40,10 @@ public BlockingRegistrationClient(RestTemplate restTemplate) {
}
@Override
- public String register(String adminUrl, Application application) {
+ public Optional register(String adminUrl, Application application) {
ResponseEntity