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
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:
- Writing/reading messages to/from other topics are similar. All example for messages are in:
72
-
`our_project_root_directory/test/data`
73
43
74
-
## Local Elasticsearch setup
44
+
### Local Deployment for Kafka
45
+
46
+
* There exists an alternate `docker-compose.yml` file that can be used to spawn containers for the following services:
47
+
48
+
| Service | Name | Port |
49
+
|----------|:-----:|:----:|
50
+
| ElasticSearch | esearch | 9200 |
51
+
| Zookeeper | zookeeper | 2181 |
52
+
| Kafka | kafka | 9092 |
75
53
76
-
- In the `docker-es` folder, run `docker-compose up`
54
+
* To have kafka create a list of desired topics on startup, there exists a file with the path `local/kafka-client/topics.txt`. Each line from the file will be added as a topic.
55
+
* To run these services simply run the following commands:
- To test the health check API, run `export PORT=5000`, start the processor, then browse `http://localhost:5000/health` in a browser,
272
256
and you will see result `{"checksRun":1}`
257
+
258
+
259
+
260
+
### Kafka Commands
261
+
262
+
If you've used `docker-compose` with the file `local/docker-compose.yml` to spawn kafka & zookeeper, you can use the following commands to manipulate kafka topics and messages:
263
+
(Replace TOPIC_NAME with the name of the desired topic)
0 commit comments