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.4.tar.gz
(2.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file relaybus_kafka-0.0.4.tar.gz.
File metadata
- Download URL: relaybus_kafka-0.0.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c77a05e9374edfeff06ce660f02a1f0de9a2656ca1985a5f9fbdbed1cf79f0a
|
|
| MD5 |
77c58ee3763b096721bf4dcd5050887c
|
|
| BLAKE2b-256 |
ebe62761c44310d9239037167b11eca5c8fb31b6b673adf18964bac5c870dbb4
|
File details
Details for the file relaybus_kafka-0.0.4-py3-none-any.whl.
File metadata
- Download URL: relaybus_kafka-0.0.4-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d3eaea963e842a167c29d62dd0b23946b15469aea67502d89d51315ea04cb0d
|
|
| MD5 |
130387b67eafba7b4f14163dec69bb90
|
|
| BLAKE2b-256 |
3d9a87c2cdd7812ad0d6ebc5db575349e8c60c86e41c7e9e644f26addaa82502
|