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.0.tar.gz
(1.9 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.0.tar.gz.
File metadata
- Download URL: base_consumer-0.1.0.tar.gz
- Upload date:
- Size: 1.9 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 |
a02b7333a8dbfd3e251b10dd7243762785303ff1e553f804f3dc3bc1c6fbd3b2
|
|
| MD5 |
bd54490a6201b55088d991693eba08c5
|
|
| BLAKE2b-256 |
c8373a31159afd7d7325aee7d1679620fdf4cd7de1fd6ae8b21d3bb977466d61
|
File details
Details for the file base_consumer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: base_consumer-0.1.0-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 |
1689775281afc9d73120620ae43d24ca9b10b49abd1d88ea622508bef4b711b3
|
|
| MD5 |
9bf881e161f21db3bf5d9a518fa84731
|
|
| BLAKE2b-256 |
2926399d018cad9c6d0b7d4fe96d42a441c2960215a63e92c5eedea2502c3ac6
|