I have two small apps, a client and a service.
Service is using -> http://dev.security.api.com:8080/api/
Client is using -> http://dev.security.com/
Using WebClient from “spring-boot-starter-webflux”, I faced the following issue.
Connection refused: dev.security.api.com/127.0.0.1:8080
I am unable to understand why it is using a different url.
The code is:
WebClient client2 = WebClient.builder()
.baseUrl("http://dev.security.api.com:8080/api")
.build();
I am using docker and they are running in two different containers.
Running the applications individually work fine, but when I am trying to send a request from client to the service. I am getting the error above.
Any ideas?
I think the error is at the ports
How to debug it:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.