No description, website, or topics provided.
Scala Batchfile HTML Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
conf
project
.gitignore
Procfile
README.md
app.json
build.sbt
sbt
sbt-launch.jar
sbt.cmd

README.md

Hello Play Kafka

Cloud Setup

  1. Deploy on Heroku

  2. Install the Kafka plugin into the Heroku CLI

     heroku plugins:install heroku-kafka
    
  3. Wait for Kafka to be provisioned:

     heroku kafka:wait -a YOUR_APP
    
  4. Add a new Kafka topic:

     heroku kafka:topics:create RandomNumbers --partitions 32 -a YOUR_APP
    
  5. Add a new Kafka consumer group:

     heroku kafka:consumer-groups:create main
    
  6. Watch the Kafka log

     heroku kafka:topics:tail RandomNumbers -a YOUR_APP
    
  7. Check out the random numbers:

     heroku open -a YOUR_APP
    

Local Setup

This uses the same Kafka system as above.

  1. Clone the source:

     git clone https://github.com/jamesward/hello-play-kafka
    
  2. Associate the local source with your Heroku app:

     heroku git:remote -a YOUR_APP
    
  3. Setup a .env file with the necessary info:

     heroku config -s > .env
    
  4. Run the web app:

     set -o allexport
     source .env
     set +o allexport
     ./sbt ~run
    
  5. Run the worker:

      set -o allexport
      source .env
      set +o allexport
     ./sbt "runMain workers.RandomNumbers"
    
  6. Check out the app: http://localhost:9000