You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
if not provided, then SSL connection is not used, direct insecure connection is used;
22
21
if provided, it can be either path to private key file or private key content
22
+
- KAFKA_GROUP_ID: Kafka group id
23
23
- CREATE_DATA_TOPIC: Kafka topic related to creation
24
24
- UPDATE_DATA_TOPIC: Kafka topic related to update
25
25
- DELETE_DATA_TOPIC: Kafka topic related to deletion
26
-
-GROUP_IDS: List of Group IDs which should be used for filtering
26
+
-LEADERBOARD_API_URL: Leaderboard API URL
27
27
- SUBMISSION_API_URL: Submission API URL
28
-
- CHALLENGE_API_URL: Challenge API URL
29
-
- MEMBER_API_URL: Member API URL
30
-
- All variables starting with prefix `AUTH0` corresponds to Auth0 related credentials
31
-
- MONGODB_URL: Mongo DB URL
28
+
- AUTH0_URL: Auth0 URL, used to get TC M2M token
29
+
- AUTH0_AUDIENCE: Auth0 audience, used to get TC M2M token
30
+
- TOKEN_CACHE_TIME: Auth0 token cache time, used to get TC M2M token
31
+
- AUTH0_CLIENT_ID: Auth0 client id, used to get TC M2M token
32
+
- AUTH0_CLIENT_SECRET: Auth0 client secret, used to get TC M2M token
33
+
- AUTH0_PROXY_SERVER_URL: Proxy Auth0 URL, used to get TC M2M token
34
+
35
+
Also note that there is a `/health` endpoint that checks for the health of the app. This sets up an expressjs server and listens on the environment variable `PORT`. It's not part of the configuration file and needs to be passed as an environment variable
36
+
37
+
Configuration for the tests is at `config/test.js`, only add such new configurations different from `config/default.js`
38
+
- WAIT_TIME: wait time used in test, default is 1000 or one second
39
+
- LEADERBOARD_API_URL: Leaderboard API URL used in testing
40
+
- SUBMISSION_API_URL: Submission API URL used in testing
32
41
33
42
## Local Kafka setup
34
43
@@ -47,7 +56,7 @@ The following parameters can be set in config files or in env variables:
- optionally, use another terminal, go to same directory, start a consumer to view the messages:
@@ -97,14 +106,43 @@ npm start
97
106
- git add .
98
107
- git commit -m init
99
108
- heroku create
100
-
- heroku config:set KAFKA_URL=... AUTH0_URL=...
109
+
- heroku config:set KAFKA_URL=... AUTH0_URL=...
101
110
- git push heroku master
102
111
103
112
## Verification
104
113
105
-
1. Ensure that Kafka is up and running and the topics `submission.notification.create, submission.notification.update and notifications.autopilot.events` are created in Kafka
114
+
1. Ensure that Kafka is up and running and the topics `submission.notification.create, submission.notification.update and submission.notification.delete` are created in Kafka
115
+
116
+
2. Refer `README.md`in`leaderboard-api` to start leaderboard api, all operations are under `leaderboard-api` project root folder
117
+
118
+
- Start mock app and it will listen on 3001 PORT.
119
+
120
+
```bash
121
+
npm run mock-api
122
+
```
123
+
124
+
- Ensure you have start MongoDB and properly configure `MONGODB_URL`. Run the following commands to clear and insert test data, step up environment variables and start the app(it will listen on 3002 PORT!).
2. Ensure that MONGODB_URL configured is correct and ensure that Submission API URL is pointing to `https://api.topcoder-dev.com/v5/submissions` (To verify based on the data present in Dev)
135
+
3. Run the following command to start processor app(Under this project's root folder)
5. You could see in the console that message will be processed
159
+
5. You could see in the console that message will be processed, and find the following message: `Record with Challenge ID # 30051825 and Member ID # 8547899 does not exists in database. Creating the record`. Also check the leaderboard-api console for more information(Console in step 2)
122
160
123
-
6. Data in the Database could be verified directly or by using the `/leaderboard` end point
161
+
6. Attach to the topic `submission.notification.update` using Kafka console producer
124
162
125
-
7. Open Postman and import the environment, collection in`docs` directory
126
-
127
-
8. Trigger the `leaderboard` end point to the verify the data present in Mongo DB
8. You could see in the console that message will be processed, and find the following message: `Record with Challenge ID # 30051825 and Member ID # 8547899 exists in database. Updating the score`. Also check the leaderboard-api console for more information(Console in step 2)
136
174
137
-
11. Attach to the topic `submission.notifcation.delete` using Kafka console producer and write the below message
175
+
9. Attach to the topic `submission.notification.delete` using Kafka console producer
0 commit comments