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

Uploaded Python 3

File details

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

File metadata

  • Download URL: relaybus_kafka-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 94d276a7a6533c3a93301b8fe30556ccdc8253673d07fbbebab3bdf8f9b5e7af
MD5 07122d585d8577b45318c8a23f790e8c
BLAKE2b-256 f1fc72c56530f3c1523c85868e8f455f353fdfbf5cc22b686d533a243f8d6969

See more details on using hashes here.

File details

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

File metadata

  • Download URL: relaybus_kafka-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 df212a2b7b5506d9db095234f6c596f66c23fed57aa43237bc11cea513b53a95
MD5 8eb4f0345751fd1a5ead59c8914271d4
BLAKE2b-256 6ec98b4231f37742f2b31d06b235c8114ca331479dbb8894deaa3a72cbd83a67

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