Skip to content

#297 Create API Gateway pattern#427

Merged
iluwatar merged 17 commits into
iluwatar:masterfrom
surgeforward:297
May 6, 2016
Merged

#297 Create API Gateway pattern#427
iluwatar merged 17 commits into
iluwatar:masterfrom
surgeforward:297

Conversation

@TylerMcConville
Copy link
Copy Markdown
Contributor

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 package from the appropriate folder (the api-gateway, price-microservice, or image-microservice folder). That command should create a JAR file in the "target" folder. Run java -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".

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.4%) to 90.488% when pulling b115c61 on surgeforward:297 into 71e3443 on iluwatar:master.

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented May 1, 2016

@TylerMcConville in general, it looks really good and works as you instructed. Here are my review comments:

  • License headers are missing from some of the files. You can autogenerate them with mvn clean install
  • In README.md I would assign Architectural category and Difficulty-Intermediate and Spring tags
  • At the moment the microservices submodules are not built when api-gateway module is built.
  • Please move the dependencies to the parent pom.xml and only reference them in api-gateway pom.xml. Also check the submodule pom.xmls.

@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented May 1, 2016

That's it, you have my review remarks. Please comment once you've addressed them and I'll take another look.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 90.355% when pulling f234a68 on surgeforward:297 into 71e3443 on iluwatar:master.

@TylerMcConville
Copy link
Copy Markdown
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:

  • Run mvn package from the parent module (api-gateway)
  • From each of the 3 submodules, in the target directory, run java -jar jar-name.jar

@iluwatar iluwatar merged commit 0ad9937 into iluwatar:master May 6, 2016
@iluwatar
Copy link
Copy Markdown
Owner

iluwatar commented May 6, 2016

@TylerMcConville look perfect! Thanks a lot for the contribution 👍

@iluwatar
Copy link
Copy Markdown
Owner

@all-contributors please add @TylerMcConville for code

@allcontributors
Copy link
Copy Markdown
Contributor

@iluwatar

I've put up a pull request to add @TylerMcConville! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants