Skip to content

MIRROR - A Python application that listens to Apache Kafka and displays messages received through a Flask server.

License

Notifications You must be signed in to change notification settings

bones-brigade/flask-kafka-openshift-python-listener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-kafka-python-listener

This application is designed to listen for JSON formatted messages broadcast on Apache Kafka. It also provides an HTTP server to access the last received message.

It is designed for use with the OpenShift Python source-to-image workflow.

Quickstart on OpenShift

oc new-app centos/python-36-centos7~https://gitlab.com/bones-brigade/flask-kafka-python-listener.git \
  -e KAFKA_BROKERS=kafka:9092 \
  -e KAFKA_TOPIC=bones-brigade \
  --name=listener

You will need to adjust the KAFKA_BROKERS and KAFKA_TOPICS variables to match your configured Kafka deployment and desired topic.

After launching the application, you will want to expose a route to its service.

oc expose svc/listener

You can see the output from the HTTP server by using the following command:

curl http://`oc get routes/sparkpi --template='{{.spec.host}}'`/sparkpi?scale=5

About

MIRROR - A Python application that listens to Apache Kafka and displays messages received through a Flask server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages