This repository contains an OS2mo AMQP Trigger that writes ADGUID to an IT system.
Adjust the AMQP_URL
variable to OS2mo's running message-broker, either;
- directly in
docker-compose.yml
or - by creating a
docker-compose.override.yaml
file.
Now start the container using docker-compose
:
docker-compose up -d
You should see the following:
[info ] Starting metrics server port=8000
[info ] Register called function=adguidsync_callback routing_key=org_unit.org_unit.*
[info ] Starting AMQP system
[info ] Establishing AMQP connection host=msg_broker path=/ port=5672 scheme=amqp user=guest
[info ] Creating AMQP channel
[info ] Attaching AMQP exchange to channel exchange=os2mo
[info ] Declaring unique message queue function=adguidsync_callback queue_name=os2mo-amqp-trigger-adguidsync_callback
[info ] Starting message listener function=adguidsync_callback
[info ] Binding routing keys function=adguidsync_callback
[info ] Binding routing-key function=adguidsync_callback routing_key=org_unit.org_unit.*
After which each message will add:
[debug ] Received message function=adguidsync_callback routing_key=org_unit.org_unit.edit
[info ] Message received object_type=org_unit payload=... request_type=edit service_type=org_unit
At which point metrics should be available at localhost:8000
, and ADGUIDs should be synced.
- Clone the repository:
git clone git@git.magenta.dk:rammearkitektur/os2mo-triggers/os2mo-amqp-trigger-adguid-sync.git
- Install all dependencies:
poetry install
- Set up pre-commit:
poetry run pre-commit install
You use poetry
and pytest
to run the tests:
poetry run pytest
You can also run specific files
poetry run pytest tests/<test_folder>/<test_file.py>
and even use filtering with -k
poetry run pytest -k "Manager"
You can use the flags -vx
where v
prints the test & x
makes the test stop if any tests fails (Verbose, X-fail)
To run the integration tests, an AMQP instance must be available.
If an instance is already available, it can be used by configuring the AMQP_URL
environmental variable. Alternatively a RabbitMQ can be started in docker, using:
docker run -d -p 5672:5672 -p 15672:15672 rabbitmq:3-management
This project uses Semantic Versioning with the following strategy:
- MAJOR: Incompatible changes to existing data models
- MINOR: Backwards compatible updates to existing data models OR new models added
- PATCH: Backwards compatible bug fixes
Magenta ApS https://magenta.dk
This project uses: MPL-2.0
This project uses REUSE for licensing. All licenses can be found in the LICENSES folder of the project.