ARTICLE AD BOX
My Spring Boot app works fine on a normal machine, but I need to run the JAR on a slow laptop and I encounter a timeout issue when Consul runs Watch.
As I understand it, the problem is that I need to increase the HTTP timeout for the HttpClient used by Consul. I have checked the available configuration parameters here but I could not find any relevant settings.
I use Spring-Boot 4.0.4 with Jetty + HTTP2 as a embedded server in my JAR.
I use the following global HTTP configuration in my application.properties, but unfortunately Consul does not recognize these settings.
spring.http.client.connect-timeout=180s spring.http.client.read-timeout=300sException I get:
2026-05-11T18:02:40.405Z ERROR 338 --- [remal-customer-service] [TaskScheduler-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8500/v1/kv/config/com/remal/gombi/remal-customer-service,default/": Total timeout 10000 ms elapsed at org.springframework.web.client.DefaultRestClient$DefaultRequestBodyUriSpec.createResourceAccessException(DefaultRestClient.java:776) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.client.DefaultRestClient$DefaultRequestBodyUriSpec.exchangeInternal(DefaultRestClient.java:624) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.client.DefaultRestClient$DefaultRequestBodyUriSpec.exchange(DefaultRestClient.java:572) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.client.RestClient$RequestHeadersSpec.exchange(RestClient.java:747) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.executeAndExtract(DefaultRestClient.java:921) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.toEntityInternal(DefaultRestClient.java:867) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.toEntity(DefaultRestClient.java:863) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.client.support.RestClientAdapter.exchangeForEntity(RestClientAdapter.java:86) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.service.invoker.HttpServiceMethod$ExchangeResponseFunction.lambda$create$3(HttpServiceMethod.java:440) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.service.invoker.HttpServiceMethod$ExchangeResponseFunction.execute(HttpServiceMethod.java:401) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.service.invoker.HttpServiceMethod.invoke(HttpServiceMethod.java:136) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.service.invoker.HttpServiceProxyFactory$HttpServiceMethodInterceptor.invoke(HttpServiceProxyFactory.java:300) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-7.0.6.jar!/:7.0.6] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:222) ~[spring-aop-7.0.6.jar!/:7.0.6] at jdk.proxy2/jdk.proxy2.$Proxy20.getKVValues(Unknown Source) ~[na:na] at org.springframework.cloud.consul.config.ConfigWatch.watchConfigKeyValues(ConfigWatch.java:159) ~[spring-cloud-consul-config-5.0.1.jar!/:5.0.1] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-7.0.6.jar!/:7.0.6] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545) ~[na:na] at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:369) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:310) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:1474) ~[na:na] Caused by: java.io.IOException: Total timeout 10000 ms elapsed at org.springframework.http.client.JettyClientHttpRequest.executeInternal(JettyClientHttpRequest.java:121) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.http.client.AbstractStreamingClientHttpRequest.executeInternal(AbstractStreamingClientHttpRequest.java:87) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:80) ~[spring-web-7.0.6.jar!/:7.0.6] at org.springframework.web.client.DefaultRestClient$DefaultRequestBodyUriSpec.exchangeInternal(DefaultRestClient.java:614) ~[spring-web-7.0.6.jar!/:7.0.6] ... 21 common frames omitted Caused by: java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed at org.eclipse.jetty.client.transport.HttpConnection$RequestTimeouts.onExpired(HttpConnection.java:347) ~[jetty-client-12.1.7.jar!/:12.1.7] at org.eclipse.jetty.client.transport.HttpConnection$RequestTimeouts.onExpired(HttpConnection.java:325) ~[jetty-client-12.1.7.jar!/:12.1.7] at org.eclipse.jetty.io.CyclicTimeouts.iterate(CyclicTimeouts.java:113) ~[jetty-io-12.1.7.jar!/:12.1.7] at org.eclipse.jetty.io.CyclicTimeouts$Timeouts.onTimeoutExpired(CyclicTimeouts.java:236) ~[jetty-io-12.1.7.jar!/:12.1.7] at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:295) ~[jetty-io-12.1.7.jar!/:12.1.7] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545) ~[na:na] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:309) ~[na:na] ... 3 common frames omittedWhat is the proper way to increase the timeout for Consul Watch that I can see in my error: Total timeout 10000 ms elapsed ?
23.3k15 gold badges100 silver badges157 bronze badges
Explore related questions
See similar questions with these tags.
