Code Monkey home page Code Monkey logo

simply-kafka's Introduction

simply-kafka

Some simple explorations, providing easy to understand reusable examples to get to grips when starting with Kafka.

Getting Started

docker compose up -d
Will start the local Kafka cluster, a data generator, Conduktor UI for interacting with Kafka on localhost:8080.

Running the TFL script will populate a topic with tube details from the TFL API, see below for more.

The consumer folder gives examples of how to consume this data that you can copy.

TFL Tube Stream

Data generator, live stream of data from the next tube approaching the Stockwell underground station from the Transport for London API.

This can be used as a Kafka producer for the local stack when an internet connection is available.

Steps involved in it's creation included:

  1. Navigating the TFL documentation site to find what endpoints held the data I wanted, how frequently it's updated and how to auth to the API
  2. Query the TFL API to grab the station codes depending which station I wanted to watch
  3. Query another part of the API to get the tube data, in this case incoming Victoria line tubes to Stockwell station
  4. Improve the reliability by building in back-offs and what to do with empty responses
  5. Capture and transform the API response into a usable JSON message
  6. Produce the JSON message into Kafka

Screenshot of my app polling the TFL API. screenshot of polling the API Screenshot from Conduktor's UI of the message in Kafka. message in Kafka

This leverages an adjusted Conduktor Docker compose stack for local development, containing a Kafka cluster and tooling.

Acknowledgements

Aiven and Quix for some producer & consumer examples to model my own around.

simply-kafka's People

Contributors

stuzanna avatar

Watchers

 avatar

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.