No project description provided
Project description
Base Consumer
The Base Consumer is a class that you will extend to create your own consumer. It provides a few helper methods that make it easier to interact with the Kafka cluster. It also offers built-in logging capabilities. Example:
from base_consumer import BaseKafkaConsumer
class EmailConsumer(BaseKafkaConsumer):
def __init__(self):
super().__init__(
broker_url="localhost:9092",
topic="email",
group_id="email-consumer",
log_file="email_consumer.log",
)
log_level = os.environ.get("LOG_LEVEL", "INFO")
self.set_logger_level(log_level) # default is INFO if not set
def process_message(self, message: dict):
# do something with the message
print(message)
if __name__ == "__main__":
consumer = EmailConsumer()
consumer.consume()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
base_consumer-0.1.2.tar.gz
(2.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file base_consumer-0.1.2.tar.gz.
File metadata
- Download URL: base_consumer-0.1.2.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4439608a3d91b1e2809b5e5389b1c28b4ef00eaa9816a4468f273794c2041aa
|
|
| MD5 |
f3a0eebc5273b00ba3581e9bac72033e
|
|
| BLAKE2b-256 |
5852a43180386965c5cc55bdd0d9827d80d3ca2b212d95a3a4cc23a60853f4cf
|
File details
Details for the file base_consumer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: base_consumer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce2bb4b6f2b61e7fdb9d5db6c2aef53c81b248de95be803dae3f356bd242bb7f
|
|
| MD5 |
dfad1436c0383989d4cc9cdfecffde44
|
|
| BLAKE2b-256 |
d2e49f45ecd3ce3f0e5ba882479898e9652d349709b937d4528a4bfcbdb8fafa
|