rihannaKe / heroku-kafka-demo-nodejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

heroku-kafka-demo-nodejs

A simple heroku app that demonstrates using Kafka in NodeJS. This demo app accepts HTTP POST requests and writes them to a topic, and has a simple page that shows the last 10 messages produced to that topic.

You'll need to provision the app.

Provisioning

Install the kafka cli plugin:

$ heroku plugins:install heroku-kafka

Create a heroku app with Kafka attached:

$ heroku create
$ heroku addons:create heroku-kafka
$ heroku kafka:wait

Create the sample topic, by default the topic will have 32 partitions:

$ heroku kafka:create messages --partitions 32

Deploy to Heroku and open the app:

$ git push heroku master
$ heroku open

About

License:MIT License


Languages

Language:HTML 83.3%Language:JavaScript 16.7%