Consumes events from Kafka and inserts them into Postgres.
Run on Heroku:
-
Follow the instructions to deploy the Dreamhouse Web App (Kafka Branch) on Heroku
-
Attach the Dreamhouse Web App's Kafka to this app:
# Get the Kafka Addon ID (e.g. kafka-something-12345) heroku addons:info heroku-kafka -a DREAMHOUSE_WEB_APP_HEROKU_APP_NAME # Attach the addon to the newly deployed app heroku addons:attach KAFKA_ADDON_ID -a DREAMHOUSE_KAFKA_POSTGRES_HEROKU_APP_NAME
-
View some properties in your Dreamhouse Web App
-
Check that the view events were consumed and then added to Postgres:
heroku pg:psql -c "SELECT * FROM interactions" -a DREAMHOUSE_KAFKA_POSTGRES_HEROKU_APP_NAME
Run Locally:
-
Fetch the NPM dependencies:
npm install
-
Get the Kafka environment variables from a Heroku app:
heroku config -s -a DREAMHOUSE_KAFKA_POSTGRES_HEROKU_APP_NAME > .env set -o allexport source .env set +o allexport
-
Start the app:
npm run dev