8000 GitHub - jamesward/hello-play-kafka
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jamesward/hello-play-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0