Skip to content

NAGARAJ08/kafka-replay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Kafka Replay CLI

PyPI version License

A simple command-line tool to fetch Kafka messages from a specific time range. Useful for replaying messages or debugging Kafka topics.


๐Ÿš€ Installation

Install from PyPI:

pip install kafka-replay

๐Ÿ”ง Usage

kafka-replay --broker <KAFKA_BROKER> --topic <TOPIC> --start-time "<START_TIME>" --end-time "<END_TIME>"

Example:

kafka-replay --broker "localhost:9092" --topic "my_topic" --start-time "2024-03-31 10:00:00" --end-time "2024-03-31 11:00:00"

To save the output to a file:

kafka-replay --broker "localhost:9092" --topic "my_topic" --start-time "2024-03-31 10:00:00" --end-time "2024-03-31 11:00:00" --output results.json

Using as a Library You can also use it in Python scripts:

from kafka_replay import KafkaReplay

kafka = KafkaReplay(broker="localhost:9092", topic="my_topic")
messages = kafka.fetch_messages("2024-03-31 10:00:00", "2024-03-31 11:00:00")

print(messages)

๐Ÿ›  Features Fetch Kafka messages between a given time range.

Supports CLI and Python API usage.

Saves output as JSON file (optional).

Graceful error handling.


๐Ÿ“œ License This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿค Contributing Contributions are welcome! Please open an issue or submit a pull request.

Next Steps Add tests

Improve performance for large data fetches

Support for different output formats (CSV, Parquet, etc.)


๐ŸŒŸ Show Your Support

If you find this tool helpful, please consider โญ starring the repository on GitHub!

About

A CLI tool to fetch Kafka messages within a specified time range

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages