-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Labels
Milestone
Description
Describe the bug
Using
@Path("/expensive-resource")
public class ExpensiveResource {
public static final String EXPENSIVE_RESOURCE_CACHE_NAME = "expensiveResourceCache";
private int invocations;
@Inject
ClientRequestService clientRequestService;
@GET
@Path("/{keyElement1}/{keyElement2}/{keyElement3}")
@CacheResult(cacheName = EXPENSIVE_RESOURCE_CACHE_NAME, lockTimeout = 5000)
public ExpensiveResponse getExpensiveResponse(@PathParam("keyElement1") @CacheKey String keyElement1,
@PathParam("keyElement2") @CacheKey String keyElement2, @PathParam("keyElement3") @CacheKey String keyElement3,
@QueryParam("foo") String foo) {
invocations++;
clientRequestService.setData("request data");
ExpensiveResponse response = new ExpensiveResponse();
response.setResult(keyElement1 + " " + keyElement2 + " " + keyElement3 + " too!");
return response;
}
where
@RequestScoped
public class ClientRequestService {
String data;
public String data() {
return data;
}
public ClientRequestService setData(String data) {
this.data = data;
return this;
}
}
@Provider
public class ClientRequestFilter implements jakarta.ws.rs.client.ClientRequestFilter {
ClientRequestService requestService;
@Inject
public ClientRequestFilter(ClientRequestService requestService) {
this.requestService = requestService;
}
@Override
public void filter(ClientRequestContext requestContext) {
if (requestService != null) {
requestContext.getHeaders().add("extra", requestService.data());
}
}
}
Leads to a context propagation exception
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of uname -a
or ver
No response
Output of java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response