My RestClient is annotated by a custom annotation and I want to get the annotation value in a ClientRequestFilter.
Here is my MicroProfile RestClient:
@Path("/greetings")
@RegisterRestClient
@MyAnnotation("myValue")
public interface MyRestClient{
@GET
public String hello();
}
I want to get the annotation value in my ClientRequestFilter:
public class MyFilter implements ClientRequestFilter {
@Override
public void filter(ClientRequestContext requestContext) {
// Here i want to get the MyAnnotation value. i.e "myValue"
}
}
I tried to call the requestContext.getClient().getAnnotations()
method but it does not work since requestContext.getClient()
is an instance of org.jboss.resteasy.microprofile.client.impl.MpClient
The implementation in question is RESTEasy. I would like to find a way to get this information from both RESTEasy classic and RESTEasy reactive implementations.
Thanks for your help