2
2
3
3
4
4
## Dependencies
5
+
5
6
- nodejs https://nodejs.org/en/ (v8+)
6
7
7
8
9
+
8
10
## Configuration
9
11
Configuration for the notification server is at ` config/default.js ` .
10
12
The following parameters can be set in config files or in env variables:
13
+
11
14
- LOG_LEVEL: the log level
12
15
- PORT: the server port
13
16
- KAFKA_OPTIONS: Kafka consumer options, see https://www.npmjs.com/package/no-kafka for available options
14
17
15
18
For the Kafka connection options:
19
+
16
20
- connectionString is comma delimited list of initial brokers list
17
21
- secure connection may be achieved via ssl field, see https://www.npmjs.com/package/no-kafka#ssl for details
18
22
19
-
20
23
## Local Kafka setup
21
24
22
25
- ` http://kafka.apache.org/quickstart ` contains details to setup and manage Kafka server,
23
26
below provides details to setup Kafka server in Mac, Windows will use bat commands in bin/windows instead
24
27
- download kafka at ` https://www.apache.org/dyn/closer.cgi?path=/kafka/1.1.0/kafka_2.11-1.1.0.tgz `
25
- - extract out the doanlowded tgz file
28
+ - extract out the downloaded tgz file
26
29
- go to extracted directory kafka_2.11-0.11.0.1
27
30
- start ZooKeeper server:
28
31
` bin/zookeeper-server-start.sh config/zookeeper.properties `
@@ -43,7 +46,6 @@ For the Kafka connection options:
43
46
- use another terminal, go to same directory, start a consumer to view the messages:
44
47
` bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic challenge.notification.create --from-beginning `
45
48
46
-
47
49
## Front end UI setup
48
50
49
51
- the front end UI's build folder content are exposed as public content by the app, so you may directly access it
@@ -52,16 +54,16 @@ For the Kafka connection options:
52
54
run ` npm install ` , ` npm start ` , then access ` http://localhost:3000 `
53
55
- note that if the front end UI's config is changed, it must be re-built using ` npm run build ` in the ui folder
54
56
55
-
56
57
## Local deployment
58
+
57
59
- setup Kafka as above
58
60
- install dependencies ` npm i `
59
61
- run code lint check ` npm run lint `
60
62
- run test ` npm run test `
61
63
- start app ` npm start ` , the app is running at ` http://localhost:4000 `
62
64
63
-
64
65
## Heroku Deployment
66
+
65
67
- git init
66
68
- git add .
67
69
- git commit -m message
@@ -70,8 +72,6 @@ For the Kafka connection options:
70
72
- heroku config: set KAFKA_PRODUCER_URL=some-public-kafka-url
71
73
- git push heroku master
72
74
73
-
74
-
75
75
## Verification
76
76
77
77
- setup stuff following above deployment
@@ -81,4 +81,3 @@ For the Kafka connection options:
81
81
- filter the messages and see results
82
82
- use the UI to post message to Kafka, see above for example message, the data stream table should also show the posted message
83
83
- you may also use the above kafka-console-consumer to view the Kafka messages
84
-
0 commit comments