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

Publisher will attempt to create the topic on first publish (requires broker permissions).

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.9.tar.gz (4.4 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.9-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: relaybus_kafka-0.0.9.tar.gz
  • Upload date:
  • Size: 4.4 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.9.tar.gz
Algorithm Hash digest
SHA256 cfc5df1868c1bc58c765649e3f7ee69c8114e417cc067880a57d911ba06fe6a5
MD5 2c968a012b3e4ceaee8d0cf315d086a0
BLAKE2b-256 12e3e963a2fd1a810a19a0a0b24b760efa8dca82d965cb921b1c0ade8cd4be88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: relaybus_kafka-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.0 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 36cd0be632e70a7ab2c0ab89896e16f761e9a86dfe16b6b5f0c9ecb2b5134dcf
MD5 72eb54edf70110e4b58e7abe6e6e9e6c
BLAKE2b-256 70a24a09f93cadf502f0126e6c5288d21f85aab740951fdf088c21ae57de795e

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