#297 Create API Gateway pattern#427
Merged
Merged
Conversation
…point to retrieve an image path
…point to retrieve a price
…lls to the Image and Price microservices
…e, and Image microservice
…erns into 297 Conflicts: pom.xml
Owner
|
@TylerMcConville in general, it looks really good and works as you instructed. Here are my review comments:
|
Owner
|
That's it, you have my review remarks. Please comment once you've addressed them and I'll take another look. |
…service. Change api-gateway packaging type to "pom". Update price-microservice and image-microservice to be true submodules of api-gateway
… reference them from api-gateway submodule pom.xml files
Contributor
Author
|
@iluwatar I have implemented all of your feedback. The structure has changed a bit: there's a new submodule, api-gateway-service, that contains the code to run the API Gateway itself. The api-gateway parent module now has a packaging type of "pom" and will build all 3 submodules when it is built. So the updated instructions to run it are:
|
Owner
|
@TylerMcConville look perfect! Thanks a lot for the contribution 👍 |
Owner
|
@all-contributors please add @TylerMcConville for code |
Contributor
|
I've put up a pull request to add @TylerMcConville! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pattern showcases an API Gateway calling 2 different microservices - one for images, and one for prices.
I created the image and price microservices as submodules of the API Gateway. I needed them to be their own distinct JARs, but also keep them a part of the API Gateway pattern. If there is a better way to do this, please let me know.
The API Gateway and microservices run with Spring Boot. To run them, first build each one by running
mvn packagefrom the appropriate folder (the api-gateway, price-microservice, or image-microservice folder). That command should create a JAR file in the "target" folder. Runjava -jar target/jar-name.jar- that should start Spring Boot. You will need to do this for the API Gateway, the Price microservice, and the Image microservice.Once both microservices and the API Gateway are running, you can test it out by hitting "localhost:50004/desktop" or "localhost:50004/mobile".