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.1.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.1.tar.gz.
File metadata
- Download URL: base_consumer-0.1.1.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 |
01b9ea87686329a74c37ac05a001bb03466dce919ee7e0f2ee8fdecada98a183
|
|
| MD5 |
f382298ef95a012fc35a56e7b680372b
|
|
| BLAKE2b-256 |
5d36f5d41eacd37e72c210f92b34d8fb15dede5d7061927721460341d9bfed96
|
File details
Details for the file base_consumer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: base_consumer-0.1.1-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 |
d02b53dda551237d919d65213224a44e244b6a75b295f348c17c7ac1966c7bf4
|
|
| MD5 |
ce8cc4e9c5b483d771f0aa7a3c9719c6
|
|
| BLAKE2b-256 |
c9866a9ef798af72eb4860cd06499b6f91c947c5707e13852de779ddac8626c3
|