Using DJabberd as a platform for external components

Martin Atkins mart at
Fri Dec 22 01:29:29 UTC 2006

Pedro Melo wrote:
> Hi,
> currently at SAPO we use POE to write our custom external components. 
> Unfortunately, some of our components are becoming CPU bound, so we went 
> looking for a new solution. DJabberd stands out as a prime candidate, of 
> course.

Hi Pedro,

Your plans inspired me to make a module that allows a DJabberd VHost to 
act as a component and connect to another JEP0114-capable server.

In the core trunk now is a module called 
DJabberd::Delivery::ComponentConnection. If you create your custom 
component as a subclass of DJabberd::Component, you should then be able 
to make use of it like this:


     <Plugin DJabberd::Delivery::ComponentConnection>
         Secret password

     <Plugin YourNamespace::Jabber::SomeComponent>
	# ... parameters ...


When DJabberd starts up with the above configuration it will attempt to 
connect to the address nominated in RemoteAddr using the JEP-0114 
"accept" protocol and, if it succeeds, it'll route outgoing messages 
from your component to the remote server and vice-versa.

I've not tested this very much; in my tests, I had it connecting to my 
own ::Component::External server implementation in a second DJabberd 
instance, so it might not work as well against other people's server 
implementations. I hope you'll give feedback and possibly some patches 
to fix it in these cases.

All the best,

More information about the Djabberd mailing list