Communication error between Spring Boot project servers using Eureka and OpenFeign

46 views Asked by At

I'm facing challenges with Microservices Architecture. I'm using Spring Gateway, Eureka, and OpenFeign. The infrastructure is set up with Docker containers for the community and user servers on EC2 instances. I've been creating APIs to enable communication between servers under Eureka. However, an issue has arisen.

When I run the code locally and communicate using Eureka and OpenFeign, everything works fine. However, when I deploy this code to AWS Cloud, I encounter the following error:

2023-11-10 13:44:25.953 ERROR 1 --- [nio-8082-exec-8] m.s.f.g.e.GlobalExceptionHandler         : UnhandledException: GET /api/communi                       ty/posting/my-posting errMessage=90f281d86fb9 executing GET http://user-service/api/user/specific-user?userId=1

I'm not sure about the reason behind this issue. How to resole this issue. help me!!

@FeignClient(name = "user-service")
public interface UserServiceFeignClient {


    @GetMapping(value = "/api/user/all-user", consumes = "application/json")
    BaseResponseDto allUser();



    @GetMapping(value = "/api/user/specific-user")
    BaseResponseDto specificUser(@RequestParam("userId") Long userId);



}

This is code about FeignClient..

"Simply put, due to the unfriendly error message, I've been searching through various communities and decided to ask the experts.

0

There are 0 answers