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)
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfc5df1868c1bc58c765649e3f7ee69c8114e417cc067880a57d911ba06fe6a5
|
|
| MD5 |
2c968a012b3e4ceaee8d0cf315d086a0
|
|
| BLAKE2b-256 |
12e3e963a2fd1a810a19a0a0b24b760efa8dca82d965cb921b1c0ade8cd4be88
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36cd0be632e70a7ab2c0ab89896e16f761e9a86dfe16b6b5f0c9ecb2b5134dcf
|
|
| MD5 |
72eb54edf70110e4b58e7abe6e6e9e6c
|
|
| BLAKE2b-256 |
70a24a09f93cadf502f0126e6c5288d21f85aab740951fdf088c21ae57de795e
|