https://github.com/oatpp/example-microservices
Example project how to do microservices using Oat++. Different build configs and monolithization.
https://github.com/oatpp/example-microservices
microservices monolith monolithization oatpp
Last synced: about 1 month ago
JSON representation
Example project how to do microservices using Oat++. Different build configs and monolithization.
- Host: GitHub
- URL: https://github.com/oatpp/example-microservices
- Owner: oatpp
- License: unlicense
- Created: 2019-10-14T21:09:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T21:28:49.000Z (about 1 year ago)
- Last Synced: 2024-10-29T22:51:37.814Z (7 months ago)
- Topics: microservices, monolith, monolithization, oatpp
- Language: C++
- Homepage: https://oatpp.io/
- Size: 62.5 KB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# example-microservices [](https://dev.azure.com/lganzzzo/lganzzzo/_build/latest?definitionId=22&branchName=master)
This is an example project on how to build microservices with Oat++ Web Framework, and how to utilize the [Monolithization](https://oatpp.io/docs/monolithization/) feature.
See more:
- [Oat++ Website](https://oatpp.io/)
- [Oat++ Github Repository](https://github.com/oatpp/oatpp)
- [Monolithization](https://oatpp.io/docs/monolithization/)## Note
For more information about this example, see the [Monolithization](https://oatpp.io/docs/monolithization/) article.
## Inside This Repository
```
|- user-service/ // User-Service source code
|- book-service/ // Book-Service source code
|- facade/ // Facade source code
|- monolith/all-services/ // Monolithic config to build all services as a Monolith
|- build_all.sh // Utility script. Build all services
|- run_all_microservices.sh // Utility script. Run all services as separate applications
```## Build And Run
### Pre Requirements
- Install the [oatpp](https://github.com/oatpp/oatpp)
- Install the [oatpp-swagger](https://github.com/oatpp/oatpp-swagger)### Build all
```bash
$ ./build_all.sh
```### Run as microservices
```bash
$ ./run_all_microservices.sh
```### Run as monolith
```bash
$ ./monolith/all-services/build/all-services-exe
```## Overview
Facade takes book info from book-service, user info from user-service, merges data, and returns to the client.
### Service ports
- Facade - 8000
- User - 8001
- Book - 8002
### Example curl```
$ curl http://localhost:8000/books/4
{"id": 4, "title": "1984", "author": {"id": 4, "name": "George Orwell"}}
```