Skip to main content

Relaybus Kafka publisher and subscriber

Project description

relaybus-kafka (Python)

Kafka publisher and subscriber utilities for Relaybus.

Install

pip install relaybus-kafka

Example

from relaybus_core import OutgoingMessage
from relaybus_kafka import (
    KafkaPublisher,
    KafkaPublisherConnectConfig,
    KafkaSubscriber,
    KafkaSubscriberConnectConfig,
)

publisher = KafkaPublisher.connect(
    KafkaPublisherConnectConfig(brokers="localhost:29092")
)
publisher.publish("relaybus.demo", OutgoingMessage(topic="relaybus.demo", payload=b"hello"))
publisher.close()

subscriber = KafkaSubscriber.connect(
    KafkaSubscriberConnectConfig(
        brokers="localhost:29092",
        group_id="relaybus",
        on_message=lambda msg: print(msg.topic, msg.payload),
    )
)
subscriber.start("relaybus.demo")

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

relaybus_kafka-0.0.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

relaybus_kafka-0.0.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file relaybus_kafka-0.0.2.tar.gz.

File metadata

  • Download URL: relaybus_kafka-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for relaybus_kafka-0.0.2.tar.gz
Algorithm Hash digest
SHA256 819024af772e48d42d3e821e8a81ccccdf9e041c53e772abd5116c89056f2db4
MD5 4c878749bf89a498b4ed16ba8147ff57
BLAKE2b-256 1f9c23be584c15bc7eb154021777d897117cb188d216209f3b6f5444ecbc1f2e

See more details on using hashes here.

File details

Details for the file relaybus_kafka-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: relaybus_kafka-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for relaybus_kafka-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e8b7a029934d54a18b885963cb1499b6af9ed024be6e19cbd9bf5f61e4783370
MD5 82312b2d7701bba6027d4ea3d75627d6
BLAKE2b-256 d4351b8ee009ed6492bfab42753cf46bdb451afc1c5b90ce900ffbba6198bb1d

See more details on using hashes here.

Supported by

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