evbus-kafka
This project contains app-merge components for pop-evbus .
Getting Started
Prerequisites
Python 3.8+
git (if installing from source, or contributing to the project)
Installation
If wanting to use evbus-kafka, you can do so by either installing from PyPI or from source.
Install from PyPI
pip install evbus-kafka
Install from source
# clone repo
git clone git@gitlab.com:vmware/idem/evbus-kafka.git
cd evbus-kafka
# Setup venv
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Usage
Configure pop-evbus for your app.
The connection portion of the kafka profile accepts any parameters that can be used in the AIOKafkaProducer class
credentials.yml
kafka:
default:
connection:
bootstrap_servers:
- localhost:9092
topics:
- topic1
- topic2
Encrypt the credentials file and export the ACCT environment variables
$ pip install acct
$ export ACCT_KEY=$(acct encrypt credentials.yml)
$ export ACCT_FILE="$PWD/credentials.yml.fernet"
Now when you put a message on the evbus queue, it will be propagated to your configured kafka implementation.
async def my_func(hub):
await hub.evbus.broker.put(body={"message": "event content"}, profile="default")
Testing
A kafka server is necessary for running the tests. You can use your own kafka server, or you can use docker . Start a local kafka server:
docker run -p 2181:2181 -p 443:9092 -p 9092:9092 \ ✔ 14s idem-core
--env ADVERTISED_LISTENERS=PLAINTEXT://localhost:443,INTERNAL://localhost:9093 \
--env LISTENERS=PLAINTEXT://0.0.0.0:9092,INTERNAL://0.0.0.0:9093 \
--env SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,INTERNAL:PLAINTEXT \
--env INTER_BROKER=INTERNAL \
krisgeus/docker-kafka
Configure credentials for testing with a local rabbitmq server:
# credentials.yml
kafka:
test_development_evbus_kafka:
connection:
bootstrap_servers: localhost:9092
Encrypt the credentials file and export the ACCT environment variables
$ pip install acct
$ export ACCT_KEY=$(acct encrypt credentials.yml)
$ export ACCT_FILE="$PWD/credentials.yml.fernet"
Install testing requirements
$ pip install -r requirements/test.in
Run the tests with pytest: .. code-block:: bash
$ pytest tests
Roadmap
Reference the open issues for a list of proposed features (and known issues).
Acknowledgements
Img Shields for making repository badges easy.
Metadata
Release files for evbus-kafka 5.0.0
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 |
|---|---|---|---|---|
| evbus-kafka-5.0.0.tar.gz | 9.8 kB | Without provenance | Details for evbus-kafka-5.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evbus_kafka-5.0.0-py3-none-any.whl | Python 3 | none | any | Details for evbus_kafka-5.0.0-py3-none-any.whl |
Total release size: 19.4 kB
Release files / evbus-kafka-5.0.0.tar.gz
| Download URL | evbus-kafka-5.0.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d42f96a04929f7bc6d65bb4b18359763758a2b2e61e2999a4766b20e47a9a2c
|
|
BLAKE2b-256 checksum How to use checksums |
5c1eca969d6d50f127a90596039c2fa3839546a6ed095a44596f556815a791ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.3 tqdm/4.65.0 importlib-metadata/6.7.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.17
|
Release files / evbus_kafka-5.0.0-py3-none-any.whl
| Download URL | evbus_kafka-5.0.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
481ddfdb5e2ebb62ab4087991b270ab296f1e477174a14f1f20e466eb8400395
|
|
BLAKE2b-256 checksum How to use checksums |
4b847a9cc3c893a2445815961439469cd6bfbda418fe1825acd9ce854c78b837
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.3 tqdm/4.65.0 importlib-metadata/6.7.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.17
|
Security for evbus-kafka 5.0.0
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.