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
This docker-compose run all the dependencies which are necessary for `project-processor-es` to work.
28
+
29
+
| Service | Name | Port |
30
+
|----------|:-----:|:----:|
31
+
| Elasticsearch | esearch | 9200 |
32
+
| Zookeeper | zookeeper | 2181 |
33
+
| Kafka | kafka | 9092 |
34
+
35
+
`docker-compose` automatically creates Kafka topics which are used by `project-processor-es` listed in `local/kafka-client/topics.txt`.
36
+
37
+
</details>
38
+
39
+
40
+
3. Set environment variables for M2M authentication: `AUTH0_CLIENT_ID`, `AUTH0_CLIENT_SECRET`, `AUTH0_URL`, `AUTH0_AUDIENCE`, `AUTH0_PROXY_SERVER_URL`:
41
+
42
+
```bash
43
+
export AUTH0_CLIENT_ID=<insert required value here>
44
+
export AUTH0_CLIENT_SECRET=<insert required value here>
45
+
export AUTH0_URL=<insert required value here>
46
+
export AUTH0_AUDIENCE=<insert required value here>
47
+
export AUTH0_PROXY_SERVER_URL=<insert required value here>
48
+
```
49
+
50
+
4. Initialize Elasticsearch indexes:
51
+
52
+
```bash
53
+
npm run sync:es
54
+
```
55
+
56
+
5. Start processor app:
57
+
58
+
```bash
59
+
npm start
60
+
```
61
+
62
+
## Commands
63
+
64
+
### Lint & Tests commands
65
+
66
+
| Command | Description |
67
+
|----------|--------------|
68
+
|`npm run lint`| Run lint check. |
69
+
|`npm run lin:fix`| Run lint check with automatic fixing of errors and warnings where possible. |
70
+
|`npm run test`| Run integration tests. |
71
+
|`npm run test:cov`| Run integration tests with coverage report. |
72
+
73
+
### View data in Elasticsearch indexes
74
+
75
+
You may run the next command to output documents in the Elasticsearch indexes for debugging purposes.
76
+
77
+
```bash
78
+
npm run view-data <INDEX_NAME><DOCUMENT_ID>
79
+
```
80
+
81
+
##### Examples
82
+
83
+
-`npm run view-data projects 1` view document with id `1` in `projects` index
84
+
-`npm run view-data timelines 1` view document with id `1` in `timelines` index
85
+
-`npm run view-data metadata 1` view document with id `1` in `timelines` index *(this index has only one document and all the data is stored inside one document which might be very big)*.
86
+
87
+
### Kafka commands
88
+
89
+
If you've used `docker-compose` with the file `local/docker-compose.yml` during local setup to spawn kafka & zookeeper, you can use the following commands to manipulate kafka topics and messages:
90
+
(Replace `TOPIC_NAME` with the name of the desired topic)
in the console, write message, one message per line:
66
-
`{"topic":"project.action.create","originator":"project-api","timestamp":"2019-06-20T13:43:25.817Z","mime-type":"application/json","payload":{"resource":"project","createdAt":"2019-06-20T13:43:23.554Z","updatedAt":"2019-06-20T13:43:23.555Z","terms":[],"id":1,"name":"test project","description":"Hello I am a test project","type":"app","createdBy":40051333,"updatedBy":40051333,"projectEligibility":[],"bookmarks":[],"external":null,"status":"draft","lastActivityAt":"2019-06-20T13:43:23.514Z","lastActivityUserId":"40051333","members":[{"createdAt":"2019-06-20T13:43:23.555Z","updatedAt":"2019-06-20T13:43:23.625Z","id":2,"isPrimary":true,"role":"manager","userId":40051333,"updatedBy":40051333,"createdBy":40051333,"projectId":2,"deletedAt":null,"deletedBy":null}],"version":"v2","directProjectId":null,"billingAccountId":null,"estimatedPrice":null,"actualPrice":null,"details":null,"cancelReason":null,"templateId":null,"deletedBy":null,"attachments":null,"phases":null,"projectUrl":"https://connect.topcoder-dev.com/projects/2"}}`
67
-
- Optionally, use another terminal, go to same directory, start a consumer to view the messages:
0 commit comments