How does one use a RestClient within an Extension? #34180
-
I need to create a Quarkus extension that includes a rest client - registered via @RegisterRestClient. I am following the tutorial in the docs The rest client:
The buildstep
When I include the extension in the app, the build fails with the following error
The TokenService and TokenMapper are other classes, which are correctly discovered during the build of the app, but not the client class. What do i need to add to make sure that the RegisterRestClient annotations are correctly handled? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I tried using a custom builder, using QuarkusRestClientBuilder, but then the error shifts to the following
Struggling to figure out how to get a Rest Client work within a quarkus extension - would really appreciate any help! |
Beta Was this translation helpful? Give feedback.
-
Hello, I have the same question, did you find a way to make it work ? |
Beta Was this translation helpful? Give feedback.
-
Use @BuildStep
AdditionalIndexedClassesBuildItem addAdditionalClasses() {
return AdditionalIndexedClassesBuildItem(TokenClient.class.getName());
} |
Beta Was this translation helpful? Give feedback.
Use
AdditionalIndexedClassesBuildItem
instead ofAdditionalBeanBuildItem
.