XRay + Spring + CompletableFuture
- Dominant language
- Java
- Stars
- 100
- Forks
- 100
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
How to use properly XRay with CompletableFuture?
*How that works right now*:
AWSXRayServletFilter is created also doing his job - catch request and create Segment for them.
However if new task is spawned (in Java with CompletableFuture), inside of this task there is no possibility to reach Segment created by AWSXRayServletFilter. What I need to do in this case, is create another Segment manually, but if I will do this two different events are pushed to XRay Console.
Is there any way to tell XRay to wait with sending Segment from AWSXRayServletFilter until he will get response from Controller.
So intead of
```
Filter -> Controller -> (spawing new thread ) -> send event to xRay
-> create new segment -> create subsegment -> send event to xRay
```
it is possible to have:
```
Filter -> Controller -> (spawing new thread ) > create new segment -> create subsegment -> send event to xRay
```
BR,
Piotr
Contributor guide
Assessment
This issue has not been assessed yet.