Member
- Joined
- Feb 9, 2023
- Messages
- 82
- Thread Author
- #1
I have deployed my springboot microservice to aws ecs.But i found that my eureka server is not avaliable after deployed to aws ecs which make my apllication cannot communicate between microservice which should be work in my local machine.The application should on different port in the same ip address
Here is the error:
Later on i have checked on aws ecs and i found that the aws ecs not supported to third party application,but there are inbound discovery service in aws ecs.Hence i have tried to to make request in webclient using dns+port directly.But it also fail with the following error:
It seems that can i just remove the eureka-client and use aws dns + port can solve the problem or how can achieve the communication between microservice in ecs
code:
Here is the error:
Code:
2023-02-27T05:53:34.937Z ERROR [api-gateway,,]` 1 --- [tbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_API-GATEWAY/***:api-gateway:8080 - was unable to send heartbeat!
Code:
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:112) ~[eureka-client-2.0.0.jar:2.0.0]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.sendHeartBeat(EurekaHttpClientDecorator.java:89) ~[eureka-client-2.0.0.jar:2.0.0]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$3.execute(EurekaHttpClientDecorator.java:92) ~[eureka-client-2.0.0.jar:2.0.0]
at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-2.0.0.jar:2.0.0]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.sendHeartBeat(EurekaHttpClientDecorator.java:89) ~[eureka-client-2.0.0.jar:2.0.0]
at com.netflix.discovery.DiscoveryClien
It seems that can i just remove the eureka-client and use aws dns + port can solve the problem or how can achieve the communication between microservice in ecs
code:
Code:
public Mono<user_info> finduser(String username){
return webClientBuilder.baseUrl("http://"+dns).build().get()
.uri(uriBuilder -> uriBuilder
.path("UserJob/get/Byusername/{username}")//"http://localhost:8082/Checkuser/{id}")
.build(username))
.retrieve()
.bodyToMono(user_info.class);
}