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.3.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.3-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: relaybus_kafka-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 9d6ea6bb9dfe28f2d1e50e5f8fdccb66d7cc95c0788fe7a0602786ea5f3428b2
MD5 a5627572b8b1d126dfce7caf3c2730e8
BLAKE2b-256 c94dfe6c64f76b11816a7fd102b9892f2cce50629c99d63da303e2f07181254c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: relaybus_kafka-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4962981891dd91ab92d03ec0235a6d4433b4fa3ba01b70ec3d00232e4ba3f531
MD5 86cac3fce45be1046cbd22459da93920
BLAKE2b-256 6eba218a3ec8357a59df413e8ae3690a2e59e0c1341cac17f3fdaaf0a89a2a2f

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