Pulsar plugin for Streamz
This a plugin for Streamz that adds stream nodes for writing and reading data from/to Pulsar.
🛠 Installation
Latest stable version is available on PyPI
pip install streamz_pulsar
Latest development version can be installed from git repo
pip install git+https://github.com/MarekWadinger/streamz_pulsar
⚡️ Quickstart
To start working with streamz_pulsar, follow these 3 steps:
1. Run a standalone Pulsar cluster locally
docker run -it -p 6650:6650 -p 8000:8080 --mount source=pulsardata,target=/pulsar/data --mount source=pulsarconf,target=/pulsar/conf apachepulsar/pulsar:latest bin/pulsar standalone
2. Create a consumer
The following example creates a consumer with the my-sub subscription name on the my-topic topic, receives incoming messages, prints the content and ID of messages that arrive, and acknowledges each message to the Pulsar broker.
import pulsar
from streamz import Stream
s = Stream.from_pulsar(
'pulsar://localhost:6650',
['my-topic'],
subscription_name='my-sub'
)
s.map(lambda x: x.decode())
L = s.sink_to_list()
s.start()
while True:
try:
if L:
print(L.pop(0))
except pulsar.Interrupted:
print("Stop receiving messages")
break
3. Create a producer
The following example creates a Python producer for the my-topic topic and sends 10 messages on that topic:
from streamz import Stream
source = Stream()
producer_ = source.to_pulsar(
'pulsar://localhost:6650',
'my-topic',
)
for i in range(3):
source.emit(('hello-pulsar-%d' % i).encode('utf-8'))
producer_.stop()
producer_.flush()
Metadata
Release files for streamz-pulsar 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| streamz_pulsar-0.1.1.tar.gz | 3.6 kB | Without provenance | Details for streamz_pulsar-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| streamz_pulsar-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for streamz_pulsar-0.1.1-py3-none-any.whl |
Total release size: 8.8 kB
Release files / streamz_pulsar-0.1.1.tar.gz
| Download URL | streamz_pulsar-0.1.1.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1505565201eb6ba612f94056ffb1d6c6f72df7d7cbc05b7189713ce9c9e87d84
|
|
BLAKE2b-256 checksum How to use checksums |
c0ef650d42fa471813c2e929afb4869934025abad004c93856df93ba17dc4934
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.1 Darwin/22.5.0
|
Release files / streamz_pulsar-0.1.1-py3-none-any.whl
| Download URL | streamz_pulsar-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e39c96d875332d6eabd24c4cdafb06b39ddad9244e2c255372c0e043a69ccee0
|
|
BLAKE2b-256 checksum How to use checksums |
9630aaf4eadaf22890084640b5ab90d568f6b889a89b7938e5aa3ebb5998bf9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.1 Darwin/22.5.0
|
Security for streamz-pulsar 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.