Giter Club home page Giter Club logo

simple-stream-kafka's Introduction

What is kafka

Kafka is an opensource distributed streaming platform that simplifies data intergration between systems. A stream is a pipeline to which your applications can push data. You can find more info on kafka's Official site

Kafka system has three main component:

  1. A Producer: The service which produces the data that needs to be broadcast

  2. A Broker: This is Kafka itself, which acts as a middle man between the producer and the consumer. It utilises the power of API's to get and broadcast data

  3. A Consumer: The service that utilises the data which the broker will broadcast

Installing Kafka

  • If you are running mac OSX simply type brew install kafka

    • once done installing run brew services start kafka
  • for linux user follow installation instruction from here

  • By default Kafka runs on port 9092

Project requirements:

  • Basic knowledge of python
  • python 3
  • Kafka installed
  • Virtualenv.
  • pip installed

setting up :

clone this repo:

Create a virtualenv and activate it inside your project directory:

  • $ virtualenv env && source env/bin/activate

Install required dependencies

  • pip install kafka-python opencv-python Flask

Running the program

You will need two terminal to run the application

In the first terminal run consumer.py. open a terminal and type:

(env)$ python producer.py

In the second terminal run producer.py and pass in a message "hello word"

(env)$ python consumer.py

Open your browser and navigate to http://0.0.0.0:5000

simple-stream-kafka's People

Contributors

dabcoder avatar amwaleh avatar

Stargazers

 avatar Luna avatar Vijay Ram avatar Abhijay Maheshwari avatar Timi avatar  avatar Nikolay Frick avatar Nguyen Anh Tuan avatar Venugopal Madathil avatar  avatar Daniel Okey-Okoro avatar Ioakim Revythas avatar Lee Joshi-Jones avatar Muhammed Şara avatar Anh Nguyen avatar 3t avatar  avatar  avatar Fubao Wu avatar  avatar  avatar Paul DeVos avatar  avatar Saish Redkar avatar ekmpls avatar Apoorva Teli avatar Porimol Chandro avatar Dennis Nderitu Kinyanjui avatar Elisha Lai avatar Jim Schwoebel avatar  avatar ABDUL KHALID avatar Feix C avatar Dam Viet  avatar hkfreenet avatar Karolus Samuel Sariola avatar Saikat Kumar Dey avatar Chris Trewin avatar Akash Nidhi P S avatar Mattia Zoccarato avatar Whats_in_name avatar Go avatar TiO2 avatar Joseph Muli avatar Akash Talole avatar

Watchers

James Cloos avatar Helton Dória avatar  avatar

simple-stream-kafka's Issues

kafka.errors.NoBrokersAvailable: NoBrokersAvailable

File "producer.py", line 6, in
producer = KafkaProducer(bootstrap_servers='localhost:9092')
File "/Users/cuemath/.virtualenvs/env1/lib/python3.7/site-packages/kafka/producer/kafka.py", line 382, in init
**self.config)
File "/Users/cuemath/.virtualenvs/env1/lib/python3.7/site-packages/kafka/client_async.py", line 242, in init
self.config['api_version'] = self.check_version(timeout=check_timeout)
File "/Users/cuemath/.virtualenvs/env1/lib/python3.7/site-packages/kafka/client_async.py", line 898, in check_version
raise Errors.NoBrokersAvailable()
kafka.errors.NoBrokersAvailable: NoBrokersAvailable

this is the error I receive while running the producer script

404 error

Hi!

very nice work i tried to reproduce.

I don't know why but when i run the producer i obtain this result (i added some stringa inside the python program):

$ python3.6 producer.py
emitting.....
success
realease the video
done emitting
(env) [root@stefano3 env]#

I mean i obtain the control of the shell immediately...it sound the video is not opened and converted, the viedo is mp4 video of 5mb size.

then when i run the consumer i tried to acces to the web page, using a virtual machine i hosted the IP address of the VM on my local machine so i try to contact the server to: http://stefano3.prv:5000
I obtain this:

192.168.56.1 - - [10/Nov/2017 16:13:02] "GET / HTTP/1.1" 404 -

Every time i try to make a call.
What i'm wronging?

KafkaUnavailableError while running producer.py

I am getting below error while running producer.py in my mac

raise KafkaUnavailableError('All servers failed to process request: %s' % hosts)
kafka.errors.KafkaUnavailableError: KafkaUnavailableError: All servers failed to process request: [('localhost', 9092, 0)]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.