Skip to content

topcoder-archive/ap-review-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Review Microservice

Microservice for supporting Topcoder Online Review platform.

Prerequisities

  • Java 8 with Maven 2+
  • Docker

Local Deployment

Configure the local/run.sh

  • configure the docker ip
export IP=192.168.99.100
  • To run Informix and kafka locally, go to the local folder 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

Inserting test records

  • Test data is present in SQL file (test_data.sql) in local folder.

  • Transfer the test_data.sql to docker environment by executing the following command

docker cp test_data.sql local_informix:/home/informix
  • Insert the records in tcs_catalog database 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.

Configuration Variables

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}"

Build Microservice

In the service folder of this project, run the following command to build the service.

mvn clean package -DskipTests

Start Microservice

Enter the local directory and run run.sh

cd local
./run.sh

Verification

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

About

review

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 16