Python client for Strimzi Kafka Bridge
Project description
kafka-bridge-client
Python async client for Strimzi Kafka Bridge and Confluent REST Proxy Package include consumer only.
Install
pip install kafka-bridge-client
Usage
By default client use Strimzi Kafka Bridge API
Consumer (async)
from kafka_bridge_client import KafkaBridgeConsumer
# Strimzi Kafka Bridge
consumer1 = KafkaBridgeConsumer(
'topic1',
'topic2',
group_id='my-group,
auto_offset_reset='earliest',
enable_auto_commit=False,
bootstrap_server='your-kafka-bridge-url',
consumer_name='consumer-name',
)
# Confluent REST Proxy
consumer2 = KafkaBridgeConsumer(
'topic1',
'topic2',
group_id='my-group,
auto_offset_reset='earliest',
enable_auto_commit=False,
bootstrap_server='your-kafka-bridge-url',
consumer_name='consumer-name',
proxy='confluent'
)
async for rec in consumer1.get_records():
print(rec['value'])
await consumer.commit()
# or
records = await consumer1.poll_records()
print(records)
await consumer.commit()
Producer (sync)
from kafka_bridge_client import KafkaBridgeProducer
producer = KafkaBridgeProducer('http://bridge.url' timeout=5)
producer.send(Message(key='1', value='value'))
Deploy
You need to change version in pyproject.toml
and run it
poetry publish --build
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
Built Distribution
Close
Hashes for kafka_bridge_client-0.7.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60a1bb4c0c35aef4d49c25309ecc604a382bf6d2bd80617dc3eb70abfa0232ab |
|
MD5 | 5860841399fb131b46214e1281ea35da |
|
BLAKE2b-256 | f13c1690b118bd188aca4c941f0f21397daa80352c0ae9522ee13d6cc247b92c |
Close
Hashes for kafka_bridge_client-0.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6abf3c21536c520887b0571400be3cb8e491d891973158f27549fa2c6217e99 |
|
MD5 | 6edd9e98e0eb9ed4e8ecd056fe55318e |
|
BLAKE2b-256 | 975b51e6d7baea1ae46820a8767a39254f1f0e00a9c2a8aaba02a6629137b557 |