Skip to content

desiter/kafka-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kafka-chat

Unleashconf 2017 - Kafka integration example

Dependencies

Installation

  $ git clone https://github.com/desiter/kafka-chat.git
  $ yarn

Kafka Producer CLI

  $ yarn run producer --broker=host:port --topic=some_topic [--key=the_key]

Paremeters:

  • --broker is required unless you are about to connect the local docker-composed default kafka broker
  • --topic desired topic name to send a message to (defaults to UnleashChat)
  • --key omit unless you want to force total order over all messages sent here

Kafka Consumer CLI

  $ yarn run consumer --broker=host:port --topic=some_topic --group=some_group

Paremeters:

  • --broker is required unless you are about to connect the local docker-composed default kafka broker
  • --topic desired topic name to subscribe to (defaults to UnleashChat)
  • --group (optional) your consumer group (defaults to test)

Local Kafka cluster (docker-compose)

You can spin up your own local kafka cluster by running the following command

  $ nano ./docker-compose.yml # put your IP address first
  $ docker-compose up -d

NOTICE: the docker based Kafka cluster requires your machine IP address to handle broker host advertising. Since localhost or 127.0.0.1 can be resolved only locally the cluster will not work if you're connecting from another machine.

About

Unleashconf 2017 - Kafka integration example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors