[JDEV] module development
Peter Gebauer
peter-jabber at restamus.org
Thu Mar 14 04:25:25 CST 2002
> What is the good way to develop a jabber module ? External
> (with JECL for example) or internal with the 'load' method ?
> And why ?
>
> thanks
It depends on what your goal is. An external connect component (a separate
daemon that connects to the Jabber server as a component and not a regular
client) is a nice way of making sure that even if your component crashes the
Jabber daemon will live on and serve it's clients.
So if you are building a complex system with many components that do many
different things it's good.
On the other hand the communication between the Jabber daemon and the
component is through one socket only. This means that if one client requests
a massive data chunk (or very long list) all other messages to and from that
component will be queued, not good if you want multiple simultaneous clients
to your component.
I made this mistake when creating a Maildir component from which many
clients could fetch email simultaneously. I hade to convert into a module
since when more than 30 clients tried to fetch email containing large
attachments, while as Jabber module I could start a thread per request.
Also, if you create a module you get Jabber API's very nice memory pooling.
So, the crash problem? You can have several Jabber daemons, I have one
instance of Jabber only for my maildir module. If it should need to
communicate with my Jabber daemon that has the IM modules I can route
packets. I do this so that if my Jabber Maildir instance crashes, my clients
will still have IM functions up and running.
Those were my two cents! :-)
/P
More information about the JDev
mailing list