Reputation: 890
Is there a way to configure Spring Boot application to produce (for example, through a gradle task) a jar-file with rest client for it?
I heard of Swagger and libraries like springdoc, springfox, but that generates web api upon application startup. And I want to automate the process of communication between microservices inside Kubernetes cluster with managing rest api clients with CI/CD instead of manual work.
Upvotes: 0
Views: 1374
Reputation: 2245
Have you tried OpenFeign? Within SpringMVC, we can use SpringMVC's @RequestMapping
and other annotations to generate a client to the API that these annotations are pointing to. Please refer the documentation here.
Now, since you want this to be automated, you may try this:
@Controller
or whichever flavour you are using.annotationProcessor
dependencyOf course, now your SpringBoot application needs @EnableFeignClients
and the corresponding dependencies.
Hope this works for you.
Upvotes: 1