Project

General

Profile

how to store message in database if user got offline and how to retrive it if user gets online in tigase pubsub

Jalpesh Khakhi
Added about 3 years ago

I want to store chat message in database in case if User_A sends message to User_B but User_B is not online then all that messages should be stored in one table. and whenever User_B will gets online. All offline messages sent to User_B should be received by User_B.

Here is my init.properties file for the configuration.

--comp-class-1 = tigase.muc.MUCComponent
--virt-hosts = sufalamtech
--user-db-uri = jdbc:mysql://localhost/tigasedb?user=tigase&password=tigase12
--user-db = mysql
--admins = admin@sufalamtech
--comp-name-4 = message-archive
--comp-name-3 = rest
config-type = --gen-config-def
--comp-name-2 = pubsub
--comp-name-1 = muc
--cluster-mode = false
--sm-plugins = +message-archive-xep-0136,jabber:iq:register,jabber:iq:auth,urn:ietf:params:xml:ns:xmpp-sasl,urn:ietf:params:xml:ns:xmpp-bind,urn:ietf:params:xml:ns:xmpp-session,roster-presence,jabber:iq:privacy,jabber:iq:version,http://jabber.org/protocol/stats,starttls,vcard-temp,http://jabber.org/protocol/commands,jabber:iq:private,urn:xmpp:ping
--debug = server,xmpp.impl,db,pubsub,component,components
--comp-class-4 = tigase.archive.MessageArchiveComponent
--comp-class-3 = tigase.http.rest.RestMessageReceiver
--comp-class-2 = tigase.pubsub.PubSubComponent


--sm-plugins=amp,-message,-msgoffline
sess-man/plugins-conf/amp/store-limit[L]=200
amp/store-limit[L]=200
sess-man/plugins-conf/amp/quota-exceeded=drop

sess-man/plugins-conf/amp/msg-pubsub-jid=pubsub.coffeebean.local
sess-man/plugins-conf/amp/msg-pubsub-node=message_sink
sess-man/plugins-conf/amp/msg-pubsub-publisher=sess-admin@sufalamtech.local

Replies (1)

Added by Wojciech Kapcia TigaseTeam about 3 years ago

For your usecase you can use our Unified Archive component instead of Message Archive component (it's a commercial extension to basic MA component, please contact office@tigase.com for details):

--comp-name-1 = unified-archive
--comp-class-1 = tigase.archive.unified.UnifiedArchiveComponent

--sm-plugins=unified-archive
sess-man/plugins-conf/unified-archive/required-store-method=message

sess-man/plugins-conf/amp/amp-repo-class=tigase.archive.unified.db.JDBCFlexibleOfflineMessageRetrievalRepository

It stores offline messages and marks them as offline in unified archived, and upon retrieval un-mark them.

    (1-1/1)