A minimal Spring Boot 4.1 example that configures the underlying client of a
declarative HTTP interface using a group configurer
(RestClientHttpServiceGroupConfigurer).
The "echo" group's client uses 100 threads and a 30s connection timeout:
@Bean
RestClientHttpServiceGroupConfigurer echoGroupConfigurer(ExecutorService echoClientExecutor) {
ClientHttpRequestFactory requestFactory = ClientHttpRequestFactoryBuilder.jdk()
.withExecutor(echoClientExecutor) // 100 threads
.build(HttpClientSettings.defaults()
.withConnectTimeout(Duration.ofSeconds(30))); // 30s connection timeout
return groups -> groups.filterByName("echo")
.forEachClient((group, clientBuilder) -> clientBuilder
.baseUrl("https://echo.zuplo.io")
.requestFactory(requestFactory));
}Uses the modular spring-boot-starter-restclient — no servlet container (Tomcat).
mvn spring-boot:run