I'm testing interservice communication with Spring Boot Rest services deployed on AWS with AppMesh and Service Discovery enabled. To be able to send messages from service a to service b I've to use the OpenFeign client to generate a proxy class.
Tech Stack
- Spring Boot OpenFeign
- AWS XRay
- ECS
- ECR
- Sleuth
- AppMesh (Virtual Node, Virtual Service)
- AWS Service Discovery (instead of Eureka)
Expected Behavior
In AWS XRay, it should show a call trace:
Client -> ServiceA -> ServiceB
Actual Behavior
In AWS XRay, I can see the call traces:
Client -> ServiceA Client -> ServiceB
Another question would be how to tell OpenFeign to use the HttpClient from AWS SDK?
Other Information
Repository available at: https://github.com/czetsuya/lab-microservice-spring-aws
I was able to fix this issue by using a dynamicNamingStrategy in tracingFilter
And create an HttpClientBuilder bean.
AWS XRay should now show the HTTP requests in the trace:
The project code is available at https://github.com/czetsuya/lab-microservice-spring-aws.