mod_pubsub
Module description¶
This module provides a lightweight, performance-focused implementation of XEP-0163: Personal Eventing Protocol, using selected parts of XEP-0060: Publish-Subscribe.
It handles same-server PEP requests addressed to users' bare JIDs and does not expose a generic PubSub service on a pubsub.@HOST@ domain.
mod_pubsub stores nodes, subscriptions, and items in RDBMS tables.
mod_caps should also be enabled for filtered PEP notifications.
Note
The goal is to gradually extend this lightweight implementation while phasing out mod_pubsub_old. Until the missing functionality is implemented here, deployments that need a generic PubSub component, collection nodes, plugin-based node implementations, or push-notification PubSub nodes still need the old module.
Supported functionality¶
- Automatic creation of PEP nodes on publish.
- Explicit node creation and deletion.
- Node configuration and publish options, with supported options described below.
- Publishing and retracting an item.
- Retrieving all items, selected items by ID, or the most recent N items.
- Explicit subscribe and unsubscribe.
- Implicit PEP subscriptions based on presence subscription and entity capabilities.
- Filtered item notifications with mod_caps, and node deletion notifications.
- Last published item delivery, with
urn:xmpp:delaymetadata. - Service discovery for PEP support on users' bare JIDs, node-qualified disco info, and disco items listing discoverable PEP nodes.
Node configuration options¶
mod_pubsub supports the following node configuration and publish options:
pubsub#access_model: controls who can access a node. Supported values areopenandpresence.pubsub#max_items: controls how many published items are stored for later retrieval. It defaults tomax, which stores all published items. A non-negative integer limits stored items for the node; when the limit is exceeded, the oldest stored item is removed.0allows publish notifications but does not persist items for later retrieval.
Known omissions and limitations¶
mod_pubsub is intended to grow over time, but it does not implement the full XEP-0060 feature set yet.
Current intentional omissions and limitations are:
- Node and publish options other than the supported node configuration options are not supported.
- Subscription options, multiple subscriptions for the same JID and node, and collection nodes are not implemented.
- Affiliations, default node configuration requests, purge, and subscription management by node owners are not implemented.
- Result Set Management is not implemented for item retrieval.
Options¶
modules.mod_pubsub.backend¶
- Syntax: string, currently only
"rdbms"is supported. - Default:
"rdbms" - Example:
backend = "rdbms"
Database backend used to store PEP nodes, subscriptions, and items.
The rdbms backend requires a default RDBMS connection pool in outgoing_pools.
modules.mod_pubsub.iqdisc.type¶
- Syntax: string, one of
"one_queue","no_queue","queues","parallel" - Default:
"no_queue"
Strategy to handle incoming IQ stanzas. By default, IQ requests are handled by the C2S process of a sender. For details, please refer to IQ processing policies.
Example Configuration¶
It is recommended to start with the default options and enable mod_caps for filtered notifications:
1 2 3 | |
The example below shows a different configuration where IQ requests are handled by a pool of 50 workers:
1 2 3 | |