Within Tigase, all pubsub component address MUST be domain-based address and not a JID style address. This was made to simplify communications structure. Tigase will automatically set component names to pubsub.domain, however any messages send to pubsub@domain will result in a SERVICE_UNAVAILABLE
error.
Pubsub nodes within Tigase can be found as a combination of JID and node where nodes will be identified akin to service discovery. For example, to address a friendly node, use the following structure:
<iq to='pubsub.domain'> <query node='friendly node'/> </iq>
Administrators can configure the maximum allowable roster size per user via the config.tdsl file.
'sess-man' { 'jabber:iqa:roster' { max_roster_size = '100' } }
This sets the roster limit to 100 entries per user. It can be set to any integer, however by default no limit is set and no configuration is set in config.tdsl
file.
Tigase can store a more detailed <unavailable/>
presence stanza to include timestamps and other information.
Ensure that presence-offline
plugin is enabled in config.tdsl. To do this, add be sure presence-offline
is listed under sess-man
'sess-man' { 'presence-offline' () {} }
The following two lines in sess-man
configure options to broadcast probes to offline users.
'sess-man' { 'skip-offline' = 'false' 'skip-offline-sys' = 'false' }
Without these lines, Tigase will not send presence probes to users that the server knows to be offline.
The full XML presence is stored under the tig_pairs table with a pkey of last-unavailable-presence
will look like this:
<presence from="user@example.com" xmlns="jabber:client" type="unavailable"> <status>Logged out</status> <delay stamp="2015-12-29T16:51:50.748Z" xmlns="urn:xmpp:delay"/></presence>
As you can see, the plugin has added a delay stamp which indicates the last time they were seen online. This may be suppressed by using the following line in your config.tdsl file.
'sess-man' { 'delay-stamp' = 'false' }
You may also limit probe responses only to newly connected resources.
'sess-man' { 'probe-full-jid' = 'true' }
When a user logs on, they will receive the same full unavailable presence statements from contacts not logged in. Also the repository entry containing their last unavailable presence will be removed.
NOTE: This will increase traffic with users with many people on their rosters.
As mentioned above, by default Tigase pubsub component uses default data source configured for Tigase XMPP Server. It is possible to use separate store by pubsub component. To do so you need to configure new DataSource
in dataSource
section. Here we will use pubsub-store
as name of newly configured data source. Additionally you need to pass name of newly configured data source to dataSourceName
property of default DAO of pubsub component.
dataSource { pubsub-store () { uri = 'jdbc:postgresql://server/pubsub-database' } } pubsub () { dao { default () { dataSourceName = 'pubsub-store' } } }
It is also possible to configure separate store for particular domain, ie. pubsub.example.com
. Here we will configure data source with name pubsub.example.com
and use it to store data for pubsub nodes and items at pubsub.example.com
:
dataSource { 'pubsub.example.com' () { uri = 'jdbc:postgresql://server/example-database' } } pubsub () { dao { 'pubsub.example.com' () { # we may not set dataSourceName as it matches name of domain } } }
With this configuration, data for other domains than pubsub.example.com
will be stored in default data source.
To enable XEP-0163: Personal Eventing Protocol support it is required to set persistent-pep
property of pubsub component to true
, set send-last-published-item-on-presence
property of component to true
and enable pep
SessionManager processor.
pubsub () { persistent-pep = true send-last-published-item-on-presence = true } sess-man () { pep () { } }
If your pubsub component uses different name than pubsub
then you need to set pubsub-jid
property of pep
processor to JID of pubsub component make it aware of a different name of a pubsub component.
Example with pubsub component named events
hosted at server named servername.com
and enabled PEP.
events () { persistent-pep = true send-last-published-item-on-presence = true } sess-man () { pep () { 'pubsub-jid' = 'events@servername.com' } }
To use REST API for pubsub component it is required that:
trusted
property (if http
is name of HTTP API component)pubsub () { trusted = [ 'http@{clusterNode}' ]; }
By default Tigase pubsub component caches node configuration of 2000 last loaded nodes. If there are many requests to database to load node configuration and your installation contains many nodes it may be a good idea to increase number of cached nodes.
To do this you need to set pubsub-repository-cache-size
property of pubsub component to new size.
pubsub () { pubsub-repository-cache-size = 4000 }
By default it is not possible to use delivery of last published item when users broadcasts initial presence. To do so you need to set send-last-published-item-on-presence
of pubsub component to true
. This will allow you to configure nodes to send last published item on presence.
pubsub () { send-last-published-item-on-presence = true }
If there is less than 10% of free heap memory available during publication of item then Tigase pubsub component will trigger Garbage Collection and it there is still very little amount of free memory will slow down delivery of notifications for published items (waiting about 1 second before continuing).
If you have assigned a lot of memory to Tigase XMPP Server or in your case this delay is not acceptable you can adjust it by pubsub component properties:
pubsub-high-memory-usage-level
to percentage of heap memory accepted as near OOM statepubsub-low-memory-delay
to number of milliseconds to wait to throttle delivery of notificationspubsub () { pubsub-high-memory-usage-level = 95 pubsub-low-memory-delay = 100 }
During creation of node pubsub component subscribes creator to pubsub node and delivers notifications to creator. If in your case you do not want this behavior, you may set auto-subscribe-node-creator
property of pubsub component to false
.
pubsub () { auto-subscribe-node-creator = false }