Skip to content

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

Node configuration options

mod_pubsub supports the following node configuration and publish options:

  • pubsub#access_model: controls who can access a node. Supported values are open and presence.
  • pubsub#max_items: controls how many published items are stored for later retrieval. It defaults to max, 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. 0 allows 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:

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
[modules.mod_caps]

[modules.mod_pubsub]

The example below shows a different configuration where IQ requests are handled by a pool of 50 workers:

1
2
3
[modules.mod_pubsub]
  iqdisc.type = "queues"
  iqdisc.workers = 50