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
+
39
+
- WAIT_TIME: wait time used in test, default is 1000 or one second
40
+
- LEADERBOARD_API_URL: Leaderboard API URL used in testing
41
+
- SUBMISSION_API_URL: Submission API URL used in testing
32
42
33
43
## Local Kafka setup
34
44
@@ -47,7 +57,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,65 +107,71 @@ npm start
97
107
- git add .
98
108
- git commit -m init
99
109
- heroku create
100
-
- heroku config:set KAFKA_URL=... AUTH0_URL=...
110
+
- heroku config:set KAFKA_URL=... AUTH0_URL=...
101
111
- git push heroku master
102
112
103
113
## Verification
104
114
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
115
+
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
106
116
107
-
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)
117
+
2.Refer `README.md` in `leaderboard-api` to start leaderboard api, all operations are under `leaderboard-api` project root folder
108
118
109
-
3. Attach to the topic `submission.notification.create` using Kafka console producer
119
+
3.Set the necessary environment variables and then run `npm start` command to start processor app(Under this project's root folder)
6. Data in the Database could be verified directly or by using the `/leaderboard` end point
133
+
6. 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 formore information(Consolein step 2)
124
134
125
-
7. Open Postman and import the environment, collection in`docs` directory
135
+
7. Attach to the topic `submission.notification.update` using Kafka console producer
126
136
127
-
8. Trigger the `leaderboard` end point to the verify the data present in Mongo DB
9. You could see inthe 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 formore information(Consolein step 2)
136
148
137
-
11. Attach to the topic `submission.notifcation.delete` using Kafka console producer and write the below message
149
+
10. Attach to the topic `submission.notification.delete` using Kafka console producer
0 commit comments