-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document the new configuration format for event pusher
- Loading branch information
Showing
8 changed files
with
128 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,52 @@ | ||
## Module Description | ||
|
||
This module is a generic interface for event-pushing backends. | ||
It defines a single callback, `push_event/3` that forwards the event to all registered backends. | ||
It defines a single callback, `push_event/2` that forwards the event to all registered backends. | ||
Each backend decides how and if to handle the event in its `push_event/2` implementation. | ||
|
||
Currently supported backends include [http], [push], [rabbit] and [sns]. | ||
Refer to their specific documentation to learn more about their functions and configuration options. | ||
|
||
### How it works | ||
|
||
The events are standardized as records that can be found in the `mod_event_pusher_events.hrl` file. | ||
Common events like user presence changes (offline and online), chat and groupchat messages (incoming | ||
and outgoing) are already hooked up to the frontend via `mod_event_pusher_hook_translator`, a | ||
`mod_event_pusher` dependency, which is a proxy between various hooks and the `push_event/3` hook | ||
handler. | ||
and outgoing) are already handled in the `mod_event_pusher_hook_translator` module, which is a proxy between various hooks and the `push_event/2` handler. | ||
|
||
!!! warning | ||
!!! Warning | ||
This module does not support [dynamic domains](../configuration/general.md#generalhost_types). | ||
|
||
## Options | ||
## Configuration | ||
|
||
### `modules.mod_event_pusher.backend` | ||
* **Syntax:** Array of TOML tables. See description. | ||
* **Default:** see description | ||
* **Example:** see description | ||
Each backend is configured in a corresponding subsection. | ||
The example below enables all backends. | ||
The `[modules.mod_event_pusher]` section itself is omitted - this is allowed in TOML, because the presence of a subsection implies that the corresponding parent section is also present. | ||
|
||
Specifies backends to register with the frontend, along with arguments that will be passed to the backend. | ||
Currently supported backends include [sns], [push], [http_notification] and [rabbit]. | ||
Refer to their specific documentation to learn more about their functions and configuration options. | ||
|
||
## Example configuration | ||
!!! Note | ||
Some backends require configuring connection pools in the `outgoing_pools` section. | ||
See the detailed documentation for each backend. | ||
|
||
```toml | ||
[modules.mod_event_pusher] | ||
backend.sns.access_key_id = "AKIAIOSFODNN7EXAMPLE" | ||
backend.sns.secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | ||
# ... | ||
|
||
backend.push.backend = "mnesia" | ||
backend.push.wpool.workers = 200 | ||
# ... | ||
|
||
backend.http.pool_name = "http_pool" | ||
backend.http.path = "/notifications" | ||
# ... | ||
|
||
backend.rabbit.presence_exchange.name ="presence" | ||
backend.rabbit.presence_exchange.type = "topic" | ||
# ... | ||
[modules.mod_event_pusher.sns] | ||
presence_updates_topic = "user_presence_updated" | ||
pm_messages_topic = "user_message_sent" | ||
muc_messages_topic = "user_messagegroup_sent" | ||
sns_host = "eu-west-1.amazonaws.com" | ||
region = "eu-west-1" | ||
access_key_id = "AKIAIOSFODNN7EXAMPLE" | ||
secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | ||
account_id = "123456789012" | ||
|
||
[modules.mod_event_pusher.push] | ||
wpool.workers = 200 | ||
|
||
[modules.mod_event_pusher.http] | ||
handlers = [{path = "/notifications"}] | ||
|
||
[modules.mod_event_pusher.rabbit] | ||
``` | ||
|
||
[sns]: ./mod_event_pusher_sns.md | ||
[http]: ./mod_event_pusher_http.md | ||
[push]: ./mod_event_pusher_push.md | ||
[http_notification]: ./mod_event_pusher_http.md | ||
[rabbit]: ./mod_event_pusher_rabbit.md | ||
[sns]: ./mod_event_pusher_sns.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.