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.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb8948183dddaddb7b324cbb4f60704b7ef86975d914df3b0fc339725eab15fd |
|
MD5 | 24858c827cce9d5dc2595e5f8caa9018 |
|
BLAKE2b-256 | 220191db9119d287e5368494abd1eb4949cf35fac326c2b7e85f0da4449c2a6c |
Close
Hashes for kafka_bridge_client-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf30d9b584fa11337ad30cdff4b9895e779b2ade5a953f3c83fc3a181d4c23f2 |
|
MD5 | f2391015f95763d53df3f0d5b0933bb8 |
|
BLAKE2b-256 | 58bf956322c2a89cc36ed40a543a41100d4fa1689c1b39a065de471dcf82bb70 |