LoadBalancerRestClientHttpServiceGroupConfigurer does not set baseUrl for @ImportHttpServices groups
Description:
Environment
- Spring Boot: 4.0.0
- Spring Cloud: 2025.1.0
- Spring Cloud Alibaba: 2025.1.0.0-SNAPSHOT
Problem
When using @ImportHttpServices with a service discovery name, the LoadBalancerRestClientHttpServiceGroupConfigurer
does not set the baseUrl correctly, resulting in "Target host is not specified" error.
Configuration
@ImportHttpServices(group = "traffic-service", types = TrafficFeignService.class)
@SpringBootApplication
public class LinkApplication { }
@HttpExchange
public interface TrafficFeignService {
@PostExchange("/api/traffic/v1/reduce")
JsonData useTraffic(@RequestBody UseTrafficRequest request);
}
Expected
The LoadBalancerRestClientHttpServiceGroupConfigurer should automatically set
baseUrl = "http://traffic-service" based on the group name.
Actual
Caused by: org.apache.hc.core5.http.ProtocolException: Target host is not specified
Workaround
Manually create the HTTP Service proxy with @LoadBalanced RestClient.Builder.
---
I am not able to reproduce this
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.