The financials microservice for the soaring the clouds sequel showcase
The Financials Microservice is a SpringBoot Application that is built using maven. From within the folder financials-ms call the following Maven Command:
mvn clean package
The Financials Microservice UI is an Oracle JET (Version 4.2) implementation and is built using Grunt. Building the application is done using the following Grunt command within the folder financials-ui:
grunt build
To serve the UI locally just run from within financials-ui folder:
grunt serve
For running the Financials Microservice locally using docker-compose, there's a respective config file with simply can be executed as described below:
- docker-compose up --build -d
- Base URL for the JET UI is http://localhost:8088
- Base URL for the service is http://localhost:7777/api/financials
This section describes how to run the Financials Microservice in a K8S environment.
Note: If you're already using an Ingress Controller within your Cluster, you can ignore this section.
Setting up Kong as Ingress Controller is straight-forward and can be done using a respective template. More information about Kong Ingress Controller could be found in Github: https://github.com/Kong/kubernetes-ingress-controller
curl https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/master/deploy/single/all-in-one-postgres.yaml \
| kubectl create -f -
After the command has been executed Kong Ingress Controller is set up in a separate Namespace "kong" and can then be used. You can get an overview of the established services using the following command.
kubectl get service -n kong
The resources needed for K8S deployments are located in the folder k8s-deploy. From here execute the following commands:
- kubectl create namespace financials
- kubectl create -f financials-ms.yml -n financials
- kubectl create -f financials-ui.yml -n financials
To ensure that the current service implementation is in sync with the API design, Dredd (https://dredd.readthedocs.io/en/latest/index.html) is used for this project.
Before executing the tests you should rebuild the Microservice backend in financials-ms and also rebuild the respective Docker image:
cd financials-ms
mvn clean package
docker build . -t <tag_name> (e.g. sbernhardtoc/financials-ms:latest)
After ensuring that the implementation is up-to-date, the Dredd tests can be executed as follows:
dredd
This executes the test and delivers an test report on the console level. It also generates a test report in Apiary.
Testing the Microservice can be done using the included Postman Collection under postman/soaring-clouds-financials-microservice.postman_collection.json.
Besides the Postman Collection, there are different environment configuration included in the Postman folder:
- Local: Points to the local environment
- CCS: Points to a potentially deployed Container Cloud Service instance
- APIPCS: Points to a potentially deployed API Platform Cloud Service instance