Mobio Kafka SDK
Project description
- Thư viện Consumer của JB. Chạy consumer ở Process, phù hợp cho môi trường K8s :
import os
from time import sleep
from pymongo import MongoClient
from mobio.libs.kafka_lib.helpers.kafka_consumer_manager import BaseKafkaConsumer
class TestConsumer(BaseKafkaConsumer):
def message_handle(self, data):
print("TestConsumer: data: {}".format(data))
if __name__ == "__main__":
url_connection = os.getenv('TEST_MONGO_URI')
client_mongo = MongoClient(url_connection, connect=False)
TestConsumer(topic="test", group_id="test", client_mongo=client_mongo, retryable=False)
sleep(1000)
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
m-kafka-sdk-v2-0.1.0.tar.gz
(6.5 kB
view hashes)