Class JaxRsServerAsyncTestEndpoint
java.lang.Object
org.eclipse.microprofile.telemetry.tracing.tck.async.JaxRsServerAsyncTestEndpoint
This endpoint is used to test MP Telemetry integration with async JAX-RS resource methods.
It does the following:
- Creates a span
- Reads the baggage entry with key
BAGGAGE_KEYand if present sets span attributeBAGGAGE_VALUE_ATTRto the entry value - Submits a subtask to a managed executor with the context propagated and returns a CompletableFuture representing the result of the subtask
- In the subtask it:
- Creates a span
- Sleeps three seconds (to ensure that there is no chance of the subtask completing before the resource method returns)
- Reads the baggage entry with key
BAGGAGE_KEYand if present sets span attributeBAGGAGE_VALUE_ATTRto the entry value - Returns "OK"
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCompletionStage(String queryValue) CompletionStage<jakarta.ws.rs.core.Response>getCompletionStageError(String queryValue) voidgetSuspend(jakarta.ws.rs.container.AsyncResponse async, String queryValue) voidgetSuspendError(jakarta.ws.rs.container.AsyncResponse async, String queryValue)
-
Field Details
-
BAGGAGE_KEY
- See Also:
-
BAGGAGE_VALUE_ATTR
-
-
Constructor Details
-
JaxRsServerAsyncTestEndpoint
public JaxRsServerAsyncTestEndpoint()
-
-
Method Details
-
getCompletionStage
@GET @Path("completionstage") public CompletionStage<String> getCompletionStage(@QueryParam("baggageValue") String queryValue) -
getCompletionStageError
@GET @Path("completionstageerror") public CompletionStage<jakarta.ws.rs.core.Response> getCompletionStageError(@QueryParam("baggageValue") String queryValue) -
getSuspend
@GET @Path("suspend") public void getSuspend(@Suspended jakarta.ws.rs.container.AsyncResponse async, @QueryParam("baggageValue") String queryValue) -
getSuspendError
@GET @Path("suspenderror") public void getSuspendError(@Suspended jakarta.ws.rs.container.AsyncResponse async, @QueryParam("baggageValue") String queryValue)
-