Using DJabberd as a platform for external components

Pedro Melo melo at
Fri Dec 22 19:16:46 UTC 2006


On Dec 22, 2006, at 1:29 AM, Martin Atkins wrote:

> 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:

Yeah, this is what I was doing exactly :)

BTW, how do you disable the C2S connection in the start() method? I  
was subclassing DJabberd just to do that.

> <VHost>
>     <Plugin DJabberd::Delivery::ComponentConnection>
>         RemoteAddr
>         Secret password
>     </Plugin>
>     <Plugin YourNamespace::Jabber::SomeComponent>
> 	# ... parameters ...
>     </Plugin>
> </VHost>
> 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'm assuming that it will use the VHost address to do authorization.  
If yes, then I'll send you a patch to be able to override that. Some  
servers, like XCP use a different name for authentication.

Also, this has some issues with some of our transports that have  
multiple hostnames but a single XEP-0114 connection. I need to check  
if VHost allows host alias.

> 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.

We will test it thoroughly... :)

Many thanks Martin,
Pedro Melo
JID: xmpp:melo at

More information about the Djabberd mailing list