Microservice for supporting Topcoder Online Review platform.
- Java 8 with Maven 2+
- Docker
- configure the docker ip
export IP=192.168.99.100
- To run Informix and kafka locally, go to the
localfolder and execute the following command:
docker-compose up
If you should ever encounter the error:
[java] Caused by: com.topcoder.db.connectionfactory.DBConnectionException: error occurs while creating the connection.
You already have 20 connections at this
time. Any further connections
Try to restart the informix database server as below:
#### log into the container based on the container name got in the previous step
docker exec -it local_informix bash
#### restart the database server
onmode -ky
oninit
-
Test data is present in SQL file (
test_data.sql) inlocalfolder. -
Transfer the
test_data.sqlto docker environment by executing the following command
docker cp test_data.sql local_informix:/home/informix
- Insert the records in
tcs_catalogdatabase by executing the following command
docker exec -it local_informix dbaccess tcs_catalog test_data.sql
- Docker environment is ready to be used in our service.
The configuration file service/src/main/resources/review-service.yaml contain the necessary configuration to get the M2M token. The dummy values should be replaced with real ones
m2mAuthConfig:
clientId: "${M2M_AUTH_CLIENT_ID:-dummy}"
clientSecret: "${M2M_AUTH_CLIENT_SECRET:-dummy}"
audience: "${M2M_AUTH_AUDIENCE:-dummy}"
m2mAuthDomain: "${M2M_AUTH_DOMAIN:-topcoder-dev.auth0.com}"
tokenExpireTimeInMinutes: "${M2M_AUTH_TOKEN_EXPIRE_TIME_IN_MINS:-60}"
auth0ProxyServerUrl: "${M2M_AUTH_PROXY_SEREVR_URL:-dummy}"
In the service folder of this project, run the following command to build the service.
mvn clean package -DskipTests
Enter the local directory and run run.sh
cd local
./run.sh
Import postman/review-microservice.postman_collection.json and postman/review-microservice.postman_environment.json, verify each endpoint.
- Ensure to select the postman environment before testing the endpoints