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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf8360df8580f0f58f84edbff815e7bcc065f8ef17fb35a7d87e49a9384acfe5 |
|
MD5 | 1256351b678cade9f9a67b535ca38af4 |
|
BLAKE2b-256 | 9290767d49b3d8cf122a2efd85c642ced979bdc66d41788d2a280cb705ad01b3 |
Hashes for jsm_transactional_ruler-2.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 263303c2d0f2b92a8d80881097af1d75333c210b0bb21322acbed977603f2637 |
|
MD5 | 0aa1f519c4eccd6f382447033909c626 |
|
BLAKE2b-256 | e97fa17d4c931cfa7398e09c1d14a205cd7effe68170d213c865326c0ccebea0 |