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
File details
Details for the file kafka-bridge-client-0.5.0.tar.gz
.
File metadata
- Download URL: kafka-bridge-client-0.5.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.10 Darwin/19.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd816b24d5d264c43722f4cdaf062caeeb800cdfe3984ef3bb8d1c4039eb6f69 |
|
MD5 | 2b72fe9071542aa386164b4e1901050f |
|
BLAKE2b-256 | d3dd8dd63f939f769f4bd8f9e0a187a79dc3865c8a2dd313f4b5ca261e5b77ed |
File details
Details for the file kafka_bridge_client-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: kafka_bridge_client-0.5.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.10 Darwin/19.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afd112dbaf5e54b590bc005fc9b149c4ba6b250b3bfbc6007a8e5afdd204c32e |
|
MD5 | 7972e7a869117fca9fd8d18deb8badc7 |
|
BLAKE2b-256 | a55d9e7a24291c621aeae5b32a442f6cecac8e028e1a4f9261a894c47261b9c6 |