Describe the bug
<spring-boot.version>2.2.5.RELEASE</spring-boot.version>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-core</artifactId>
<version>2.2.9.RELEASE</version>
</dependency>
the main error trace, i think /127.0.0.1:8002 should be connected, not /127.0.0.1:80
feign.RetryableException: Failed to connect to /127.0.0.1:80 executing POST http://127.0.0.1:8002/xxx
Caused by: java.net.ConnectException: Failed to connect to /127.0.0.1:80
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:297)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at com.tencent.tdms.cloud.client.okhttp.TdmsOkHttpClientInterceptor.intercept(TdmsOkHttpClientInterceptor.java:74)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
at feign.okhttp.OkHttpClient.execute(OkHttpClient.java:169)
at org.springframework.cloud.openfeign.loadbalancer.FeignBlockingLoadBalancerClient.execute(FeignBlockingLoadBalancerClient.java:78)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:119)
... 83 common frames omitted
Sample If possible, please provide a test case or sample application that reproduces the problem. This makes it much easier for us to diagnose the problem and to verify that we have fixed it.
@FeignClient(name = "InfoApiClient", url = "",contextId = "InfoApiClient")
public interface ApiClient {
@ResponseBody
@RequestMapping(
value = {"xxx},
method = {RequestMethod.POST},
produces = {"application/json"}
)
GetInfoResponse getInfoByIds(URI uri, @RequestBody GetInfoByIdsRequest request);
}
apiClient.getInfoByIds(new URI("http://127.0.0.1:8002"),request);
maybe this method need consider about the port?
org.springframework.cloud.openfeign.loadbalancer.FeignBlockingLoadBalancerClient.execute
String serviceId = originalUri.getHost();
Comment From: OlgaMaciaszek
Hi, @liuyinghus.t It does not seem like an SC OpenFeign issue. It seems that either there's nothing running at that host and port or it's not accepting connections. I can still take a look at this, but you would need to provide a minimal, complete, verifiable example that reproduces the issue (such as a link to a GH project with a small sample and instructions on how to reproduce the issue based on the code in the sample or tests that demonstrate it). Also, please learn how to properly format code and logs.
Comment From: spring-cloud-issues
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.
Comment From: spring-cloud-issues
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.