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()
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.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee139ea2d8d6114d939f0b6746cb7b5aa8b168473901646afa6efeb43e2e9d90 |
|
MD5 | fc544a4237aad0508a9c150358472cf5 |
|
BLAKE2b-256 | 7deed19190098938e1bddfdbc378461952420c289d8812da5505d00e0980735d |
Close
Hashes for kafka_bridge_client-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9943eadafe221b7d6a6bee5a49dd53fad7e87d1364280e66473789ccaef12ac9 |
|
MD5 | 68a0971d9efafadaa5da879cc2f6b4b8 |
|
BLAKE2b-256 | bb4e42ae819b99a04fa971a130b57cf2ee09862ddc90ea350988ea160438902f |