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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48d1aad2bcae660ceaf6ba9d738bc78efcd408c40815237840528466362fb682 |
|
MD5 | 0dac777a20f74c7e58abfbcbaf6a39be |
|
BLAKE2b-256 | b12c077fd07988be0d715b373660a733c7420fcefc9a54fb8cac77f58e13f470 |
Close
Hashes for kafka_bridge_client-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e6b3f2a7443656b7b4614fe5c4bb1e9c396006e7a9bf805e4cdedc5ab02b4d |
|
MD5 | b6cef29479307780ad6c08e492911c59 |
|
BLAKE2b-256 | 8fdbd5ce9a326cf3491acddff7822c49c7e29c150d630944ec04ecc14dc44cce |