Notifications center/Delivery API: Difference between revisions
|  (Created page with "The delivery API is a HTTP to AMQP gateway.  It has been built to use an AMQP broker from languages where it's not convenient to use an AMQP library (e.g. TCL, Rust with OpenS...") |  (+cat) | ||
| Line 14: | Line 14: | ||
| ==== Deploy the microservice ==== | ==== Deploy the microservice ==== | ||
| To deploy it, you can: | To deploy it, you can: | ||
| * fire a Docker container with our image <code>nasqueron/notifications-delivery</ | * fire a Docker container with our image <code>nasqueron/notifications-delivery</code>, or, | ||
| * follow instructions at http://flask.pocoo.org/docs/0.12/deploying/ | * follow instructions at http://flask.pocoo.org/docs/0.12/deploying/ | ||
| Line 49: | Line 49: | ||
| === Report bugs or request new feature === | === Report bugs or request new feature === | ||
| You can [https://devcentral.nasqueron.org/maniphest/task/edit/form/1/?project=notifications_center&title=Delivery%20API:%20 create a task] at DevCentral. | You can [https://devcentral.nasqueron.org/maniphest/task/edit/form/1/?project=notifications_center&title=Delivery%20API:%20 create a task] at DevCentral. | ||
| [[Category:Notifications center|Delivery API]] | |||
| [[Category:API]] | |||
| [[Category:Python]] | |||
Revision as of 21:48, 24 October 2024
The delivery API is a HTTP to AMQP gateway.
It has been built to use an AMQP broker from languages where it's not convenient to use an AMQP library (e.g. TCL, Rust with OpenSSL 1.1+).
Administration guide
Introduction
This is a microservice shipped as a Flask application.
It reads configuration from environment, connects to a broker, fire a Werkzeug WSGI application.
Then, it accepts requests to interact with the broker in HTTP.
Deployment
Deploy the microservice
To deploy it, you can:
- fire a Docker container with our image nasqueron/notifications-delivery, or,
- follow instructions at http://flask.pocoo.org/docs/0.12/deploying/
It requires the following environment variable to be defined:
- BROKER_HOST: the domain of your broker
- BROKER_USERNAME: an username to connect to the broker
- BROKER_PASSWORD: a password to connect to the broker
If you don't use the / vhost, you can add:
- BROKER_VHOST: the vhost to use
Front-end web server configuration
Then, in your front-end web server, amend the notifications center's configuration to pass requests for /delivery to this service.
server {
    server_name notifications.domain.tld;
    #...
    location /delivery {
        proxy_pass http://localhost:37180;
    }
}Of course, you can also deploy this as a standalone product, it's fully independent from other notifications center component.
Exit codes
If the server can't attach to the broker, it will quit with the following exit codes:
- 1: configuration can't be read, ensure you've BROKER_HOST, BROKER_USERNAME and BROKER_PASSWORD defined in the environment
- 2: can't login to the broker
Report bugs or request new feature
You can create a task at DevCentral.

