RabbitMQ usage#

In order to communicate events from listeners to dispatchers or applications, TeaL requires the following elements for exchanging such events:

  • An AMQ-compatible server[1].

  • An exchange prefix, which can be set up if the AMQ-compatible server is also used by other clients for other purposes.

Note

Note that the exchange prefix is implicitely used in all names described within this document; for example, if the prefix is teal_, the exchange name for callback events will be teal_callbacks.

By default, this prefix is empty.

Events use one direct exchange per message type, and message types define their own routing key. This allows for:

  • Decoding messages with the right format depending the exchange the message comes from.

  • Only binding to certain events for a given message types, such as certain callback states.

This logic is implemented by AMQHandler.

In the following sections, we will describe the different message types and the exchanges and routing keys that are used with them.

Note

All message payloads provided below are UTF-8 JSON-encoded objects.

Callback events#

Callback events are sent on the callbacks exchange, as represented by the AMQExchangeName.CALLBACKS constant. The routing key for such events is the callback state, such as 123.

The structure of such messages are defined in CallbackMessage.

OpenID CIBA callback events#

OpenID Client-Initiated Backchannel Authentication callback events are sent on the openid_ciba_callbacks exchange, as represented by the AMQExchangeName.OPENID_CIBA_CALLBACKS constant. The routing key for such events is the authentication request identifier, such as 4de32afb-c9df-4b0d-8502-fb976766ba53.

The structure of such messages are defined in OpenIDCIBACallbackMessage.

Powens webhooks by domain#

Powens webhook events are sent on the powens_domain_webhooks exchange, as represented by the AMQExchangeName.POWENS_DOMAIN_WEBHOOKS constant. The routing key for such events is the fully-qualified Powens domain, such as budgea.biapi.pro.

The structure of such messages are defined in PowensWebhookMessage.