Giter VIP home page Giter VIP logo

jiyamaryjoseph / kafka-consumer-as-cassandra Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11.03 MB

The Confluent Kafka Consumer as Cassandra repository offers a Python-based solution to seamlessly transfer data from Apache Kafka topics to Apache Cassandra, facilitating real-time data processing and storage with simplicity and efficiency

License: MIT License

Dockerfile 0.15% Jupyter Notebook 81.37% Python 18.41% Shell 0.07%

kafka-consumer-as-cassandra's Introduction

Confluent Kafka Python Data Pipeline

alt text

This repository provides a solution to publish and consume data to and from Apache Kafka using the Confluent Kafka Python client, with messages formatted in JSON.

Introduction

The Confluent Kafka Python Data Pipeline project offers a streamlined approach to working with Apache Kafka, a distributed event streaming platform, in Python. It facilitates the publishing and consumption of JSON-formatted data to and from Kafka clusters.

Setup

Follow these steps to set up the environment and run the application:

  1. Create Conda Environment:

conda create -n myenv python=3.8 -y

  1. Activate Environment:

conda activate myenv

  1. Install Requirements:

pip install -r requirements.txt

  1. Set Environment Variables: Update the necessary environment variables in the .env file with your Kafka cluster credentials, schema registry API credentials, and DATASTAX Astra Cassandra.

  2. Build Docker Image:

docker build -t data-pipeline:lts .

  1. Run Docker Container: For Linux or macOS:

docker run -it -v $(pwd)/logs:/logs --env-file=$(pwd)/.env data-pipeline:lts

Environment Variables

  • Cluster Environment Variables:

  • API_KEY: API key for accessing the Kafka cluster.

  • API_SECRET_KEY: Secret key for accessing the Kafka cluster.

  • BOOTSTRAP_SERVER: Kafka bootstrap server address.

  • Schema Registry Environment Variables:

  • SCHEMA_REGISTRY_API_KEY: API key for accessing the Schema Registry.

  • SCHEMA_REGISTRY_API_SECRET: Secret key for accessing the Schema Registry.

  • ENDPOINT_SCHEMA_URL: URL of the Schema Registry endpoint.

  • Database Environment Variable:

  • CASSENDRA_CONNECT_BUNDLE: Bundle download from Datastax astra

  • CASSENDRA_TOKEN_FILE: token download from Datastax astra

Docker Usage

This project utilizes Docker for containerization. Follow the instructions provided in the "Setup" section above to build the Docker image and run the container.

License

This project is licensed under the MIT License. See the LICENSE file for details.

kafka-consumer-as-cassandra's People

Contributors

jiyamaryjoseph 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.