[ejabberd] mod_roster_odbc - feeding updates to SQL backend?

Martin Langhoff martin.langhoff at gmail.com
Thu Jan 22 20:19:20 MSK 2009


Hi,

I am working on an ejabberd setup that reads a number of "shared
rosters" from PostgreSQL. A bit of background here:

http://lists.jabber.ru/pipermail/ejabberd/2008-November/004404.html

The shared rosters match groups managed on a webapp (in this case,
Moodle). However, if the roster is changed server-side, for example a
user is enrolled in a group (actually, a course) while that user XMPP
session is _open_ then PostgreSQL will have the new data, but
mod_roster_odbc won't see it until the client requests an update.
Which could take ages.

What I'd like is for the update to be immediate for the end users.
Scenario: teacher adds me to the course (on the webapp Moodle), I look
back at my laptop and whoa! all my course-mates are in my "network"
view...

Is it possible to trigger an update on the client side based on
operations that happen on Pg? Is there something magic behind the
scenes that would make this work?

One Postgres-style of addressing this would be to teach
mod_roster_odbc to use LISTEN, and handle the callbacks. No
erlang-postgres connector I know of supports LISTEN callbacks :-/ and
ODBC most surely won't.

cheers,



martin
-- 
 martin.langhoff at gmail.com
 martin at laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


More information about the ejabberd mailing list