I’ve construct a number of small REST companies based mostly on spring-boot. Every of this REST service has an personal database, personal configuration and might run independently with out the opposite companies. Every service is mapped to a separate port. You may simply begin it and invoke every of the supplied REST endpoint.
In entrance, I’ve construct an “API-Gateway” based mostly on spring-boot which acts as an mixture service speaking with every of the small REST companies over HTTP to assemble some information or to carry out some operations utilizing a number of REST service. Presently, every thing runs on my machine so the entire communications goes over localhost and the precise port of the precise service.
What I now need to obtain or to strive is the next:
- The present API Gateway ought to use the present spring-boot REST companies as a dependency within the POM file
- It ought to nonetheless be attainable to run every of the small REST independently. That implies that I can simply
spring-boot:runand the service exposes the REST API below a selected port. Even when its used as a tough dependency in my API-Gateway
- Every of the small service ought to nonetheless use its personal database so there ought to be no fats database which holds all information.
- When operating the large fats API-Gateway with all of the small companies as dependency, the small companies shouldn’t be mapped on particular port and mustn’t expose the a number of REST APIs. I assume that this is not going to occur because the companies usually are not began utilizing
spring-boot:runhowever I simply wished to level this out.
- From architectural perspective: The communication with the dependency ought to be applied utilizing an
Interfacedefining the required strategies. That ought to make it simple in future to exchange the calls to the dependency instantly with some separate operating REST endpoint by offering one other implementation of that interface.
- Query: I assume that the large fats API Gateway mustn’t use the already current Controller implementation of the REST companies for invoking the strategies. As an alternative, I assume, the REST service ought to present a separate API for direct communication?
What’s one of the best ways in attaining the above famous data and necessities?
Thanks upfront and I hope in your assist and your concepts.
PS: Please inform me if that’s the incorrect stack trade community for this query.