Skip to main content

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.

License: MIT PRs Welcome PyPI version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kafka-bridge-client-0.5.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

kafka_bridge_client-0.5.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file kafka-bridge-client-0.5.2.tar.gz.

File metadata

  • Download URL: kafka-bridge-client-0.5.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.10 Darwin/19.6.0

File hashes

Hashes for kafka-bridge-client-0.5.2.tar.gz
Algorithm Hash digest
SHA256 83f5316fc653e08b4d06a5081f461439cb698b086a145f7d8309992f15735cf5
MD5 9bc058f1e525e4a3cc53d44595b2e6a8
BLAKE2b-256 b8ed1695425f53e0e099cc74dec507958595be2d36326e1e7f94de54cad3c4af

See more details on using hashes here.

File details

Details for the file kafka_bridge_client-0.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for kafka_bridge_client-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 05a6f124f509220c9d432f8eea4ec76626e579ecb55eea7fb7d61adee4f3f423
MD5 e2c2ff36836ebb007520bed8ad95c5b8
BLAKE2b-256 72200f2e3faedb9d580d8964287017494636a27bc3de22fc5a4a397545a4ca78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page