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
Hashes for jsm_transactional_ruler-2.8.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ba04b04db3ac1acbe980b4f2d366342151985ea7ea14fb24a28a28829b8767d |
|
MD5 | 57e2bde438e2867d6a6f723393d50fd7 |
|
BLAKE2b-256 | b9766c978a8eea41b15939c9de5086a2ca88a4bf3faa6251b681a8937706a28e |
Hashes for jsm_transactional_ruler-2.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d95d6a47df7f24a405254cb7b09e348c6525dc14579e24a7b6eef3b01cf50c3 |
|
MD5 | d13171d3684afc0ed72654d7ee901c88 |
|
BLAKE2b-256 | 16c44ed12f33df833684ef44de0d2acd4615bc3cfb932ea5aeeafb8c26ca2cab |