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.5.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ad17c76c2e96446735e811a95c07e29cc0f924be6700955b97faf5795f87016 |
|
MD5 | fa0f28a509dc278a7c14ce1259f3f547 |
|
BLAKE2b-256 | a70a3fb6d78b5abae700c7d5ef924ce4a98ba838925d83339666084586370f49 |
Close
Hashes for kafka_bridge_client-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8494a98bde9e456544e4acba4a12f4629211f85d26d223fe2d3576360c190a0b |
|
MD5 | a99f07a19c4541a15b94c1e23c257066 |
|
BLAKE2b-256 | 0e76238c9e10deb2e7a30d85e8bfed0e40b5e9d703facf398e4a0b3c402db18f |