Configuration

Configuration of user repository for Tigase XMPP Server

To configure Tigase XMPP Server to use MongoDB you need to set --user-db-uri= in etc/init.properties file to proper MongoDB URI pointing to which MongoDB database should be used (it will be created by MongoDB if it does not exist). --user-db property should not be set to let Tigase XMPP Server autodetect proper implementation of UserRepository. Tigase XMPP Server will create proper collections in MongoDB if they do not exist so no schema files are necessary.

Example configuration of XMPP Server pointing to MongoDB database tigase_test in a local instance:

--user-db-uri=mongodb://localhost/tigase_test

If Tigase Server is not able to detect a proper storage layer implementation, it can be forced to use one provided by Tigase using the following lines in etc/init.properties file:

--user-db=tigase.mongodb.MongoRepository
--auth-db=tigase.mongodb.MongoRepository

Every component should be able to use proper implementation to support MongoDB using this URI. Also MongoDB URI can be passed as any URI in configuration of any component.

Configuration for MUC

By default, MUC component will use MongoDB to store data if Tigase is configured to use it as a default store. However, if you would like to use a different MongoDB database to store MUC message archive, you can do this by adding the following line to etc/init.properties file:

muc/history-db-uri=mongodb://localhost/tigase_test

If MUC components fails to detect and use a proper storage layer for MongoDB, you can force it to use one provided by Tigase by using the following line in the init.properties file:

muc/history-db=tigase.mongodb.muc.MongoHistoryProvider
Configuration for PubSub

By default, PubSub component will use MongoDB to store data if Tigase is configured to use it as a default store. However, if you would like to use a different MongoDB database to store PubSub component data, you can do this by adding the following line to etc/init.properties file:

pubsub/pubsub-repo-url=mongodb://localhost/tigase_test

If the PubSub components fails to detect and use a proper storage layer for MongoDB, you can force it to use one provided by Tigase by using the following line in the init.properties file:

pubsub/pubsub-repo-class=tigase.mongodb.pubsub.PubSubDAOMongo
Configuration for Message Archiving

By default, the Message Archiving component will use MongoDB to store data if Tigase is configured to use it as a default store. However, if you would like to use a different MongoDB database to store message archives, you can do this by adding the following line to etc/init.properties file:

message-archive/archive-repo-uri=mongodb://localhost/tigase_test

If Message Archiving component fails to detect and use a proper storage layer for MongoDB, you can force it to use one provided by Tigase by using the following line in the init.properties file:

message-archive/archive-repo-class=tigase.mongodb.archive.MongoMessageArchiveRepository