Lib to post user events on transactional topics
Project description
Transactional Ruler
Lib to post user events on transactional topics
Running tests and lint
docker-compose up integration-tests
docker-compose up lint
Installation
pip install jsm-transactional-ruler
Example Usage
from jsm_transactional_ruler.enums import EventType
from jsm_transactional_ruler.events import Event
from jsm_transactional_ruler.publisher import publish_event
event = Event(
user_id="fake_id", event_type=EventType.T_EVENT_REGISTERED_USER, data={"email": "teste@juntossomosmais.com.br"}
)
publish_event(event_trigger=event)
The attribute event_type
accepts only events registered in the EventType
enum.
The publish_event
method accepts the optional queue
and publisher_parameters
parameters to send to django-stomp:
event = Event(
user_id="fake_id", event_type=EventType.T_EVENT_REGISTERED_USER, data={"email": "teste@juntossomosmais.com.br"}
)
publish_event(event_trigger=event, queue="/topic/VirtualTopic.user-update-transactions", persistent=False)
Versioning
This lib follows the pypi version format with the convention of using major.minor.patch version.
When to bump a patch version?
Bump the patch version if you are doing a quick fix, nothing that changes the library functionality.
When to bump the minor version?
Bump the minor version if you are adding new functionality without breaking backwards compatibility. For example, adding support to new events.
When to bump the major version?
Bump the major version if you are breaking backwards compatibility by adding new functionality or refactoring.
Contributing
This project uses a trunk based development flow, so that we have only one long-lived branch (master
).
For any development, simply create a branch from it and follow the flow described below.
How to upload lib to PyPI
It is necessary to update the lib version using the command below:
$ poetry version major|minor|patch
After generating the version:
- Create a new branch with the files updated by Poetry
- Open PR based on the
master
branch - Merge PR into the master
- Generate a new release based on the version. Document to generate release
- After generating the new release "Github Actions" will upload the lib to PyPI using Poetry.
- Good job!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jsm_transactional_ruler-3.0.0.tar.gz
.
File metadata
- Download URL: jsm_transactional_ruler-3.0.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e15f8e70696b6bbde2fb09e9a626710e63fa4fc0582ff2df9bc276efe3496677 |
|
MD5 | b0c00c8f48a3f5f1b53b572a522f83f6 |
|
BLAKE2b-256 | c8b222115effa114cbb78ef51da7b4640bb508d1659a55b878102b1cef1b68f8 |
File details
Details for the file jsm_transactional_ruler-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: jsm_transactional_ruler-3.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6508b126099237066053c0a56499ee43d15b27ebacd0677f3557d6d3f4e2e661 |
|
MD5 | 1199cfee300d2d8ea00b5f2f775b014e |
|
BLAKE2b-256 | 4ae5cbe8cb2a26f965512fbc68492a370a9949b6c08a62e092a625d1e14fcffe |