'my rest easy filter in a extension runtime is not discovered

I have a custom quarkus extension from where I want to provide a resteasy request filter like below

@Provider
public class ReqFilter implements ContainerRequestFilter {
    @Override
    public void filter(ContainerRequestContext requestContext) throws IOException {
        System.out.println(requestContext.getUriInfo().getPath());
    }
}

I have this class in my runtime module, but it is not discovered or configured in reasteasy requests in integration-test project

Please let me know how to provide @Provider to resteasy

An example can be found here



Solution 1:[1]

Extensions are not indexed automatically.

See How to create a Jandex index in Quarkus for classes in a external module for ways to index them.

When using quarkus-resteasy, in order to have your extension register a provider, you can generate ResteasyJaxrsProviderBuildItem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1