Table of Contents
To enable Tigase MUC Component you need to add following block to etc/init.properties
file:
muc () { }
It will enable component and configure it under name muc
.
By default it will also use database configured as default
data source to store data - including room configuration, affiliations and chat history.
As mentioned above, by default Tigase MUC component uses default
data source configured for Tigase XMPP Server.
It is possible to use separate store by MUC component.
To do so you need to configure new DataSource
in dataSource
section.
Here we will use muc-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 MUC component.
dataSource { muc-store () { uri = 'jdbc:postgresql://server/muc-database' } } muc () { muc-dao { default () { dataSourceName = 'muc-store' } } }
It is also possible to configure separate store for particular domain, ie. muc.example.com
.
Here we will configure data source with name muc.example.com
and use it to store data for MUC rooms hosted at muc.example.com
:
dataSource { 'muc.example.com' () { uri = 'jdbc:postgresql://server/example-database' } } muc () { muc-dao { 'muc.example.com' () { # we may not set dataSourceName as it matches name of domain } } }
With this configuration room data for other domains than example.com will be stored in default data source.