Add option to store offline message to MySQL or other DB
MattJ
on
Hi Thomas, thanks for filing this featue request!
I'd be interested to know more about how you would use this feature. Ultimately: why do you want it?
Thanks!
Changes
ownerMattJ
Thomas
on
Hi,
for example i can use with two server for delivery the offline message or if one server is down i can start an other without lost
Praveen
on
Say when you are using it for an in-app chat application and the user has not opened the app. We could use the data in the table to notify the user that he has messages to be viewed. Lets say a GCM or an APNS notification.
Thomas
on
And also all modlus use sql storage, i think also this must be for standard
MattJ
on
Praveen: the correct way to implement that would be through a Prosody module that hooks the "message/offline/handle" event. See mod_offline_email in prosody-modules for an example of this (which "pushes" offline messages over email). Polling the database would be inefficient.
Thomas: For the multiple server use-case: this isn't really reliable until Prosody implements clustering, and when it does, I doubt it will depend on SQL.
In general: I'm not 100% sure that every kind of data is suitable for storage in an SQL database. Yes, it *can* be done, but that doesn't make it a good idea... :)
That said, we are planning to move offline messages to our archive storage API (the same one used by MAM), and since mod_storage_sql supports that, you'll be able to store offline messages there if you want.
Changes
tags Status-Accepted
Zash
on
With https://hg.prosody.im/0.10/rev/8eec715c13a6 it should now be possible to get archives into SQL, or wherever.
Note that upgrading may leave unreachable messages in the old list files. These can be migrated using mod_migrate from prosody-modules.
Add option to store offline message to MySQL or other DB
Hi Thomas, thanks for filing this featue request! I'd be interested to know more about how you would use this feature. Ultimately: why do you want it? Thanks!
ChangesHi, for example i can use with two server for delivery the offline message or if one server is down i can start an other without lost
Say when you are using it for an in-app chat application and the user has not opened the app. We could use the data in the table to notify the user that he has messages to be viewed. Lets say a GCM or an APNS notification.
And also all modlus use sql storage, i think also this must be for standard
Praveen: the correct way to implement that would be through a Prosody module that hooks the "message/offline/handle" event. See mod_offline_email in prosody-modules for an example of this (which "pushes" offline messages over email). Polling the database would be inefficient. Thomas: For the multiple server use-case: this isn't really reliable until Prosody implements clustering, and when it does, I doubt it will depend on SQL. In general: I'm not 100% sure that every kind of data is suitable for storage in an SQL database. Yes, it *can* be done, but that doesn't make it a good idea... :) That said, we are planning to move offline messages to our archive storage API (the same one used by MAM), and since mod_storage_sql supports that, you'll be able to store offline messages there if you want.
ChangesWith https://hg.prosody.im/0.10/rev/8eec715c13a6 it should now be possible to get archives into SQL, or wherever. Note that upgrading may leave unreachable messages in the old list files. These can be migrated using mod_migrate from prosody-modules.
ChangesMattJZash