[jdev] Collaboration on BOSH servlet?

Stefan Strigler steve at zeank.in-berlin.de
Fri Jan 11 04:04:49 CST 2008


Am Donnerstag, den 10.01.2008, 08:57 +1100 schrieb Greg Wilkins:

> It's a pity that JabberHTTPBind is GPL, as I do most of my work under
> apache-2.0 and there are some issues mixing and matching.   So eventually
> it would be good to have an apache 2 licensed version of the same thing.

There's no problem with re-licensing it under some other opensource

> The key thing to change with your servlet is the sess.sock.wait();
> waiting in servlets is expensive as it holds a thread, buffers and other
> resources.   The idea is to replace the wait with suspend/resume semantics.
> We have suspend/resume in Jetty now and there is a proposal to include
> it in Servlet 3.0.  Actually, it is probably worthwhile waiting a month
> so JSR-315 has time to make some progress in deciding if suspend/resume
> will be support... then you can move towards the future standard.

Any chance to make use of it while keeping compatible to other
implementations like tomcat?

> My other concern with scalability is the use of a DocumentBuilder that
> will create lots of Dom objects on each and every request that will need
> to be garbage collected.  Specially as it looks like it may parse the
> message bodies as well, even though they are simply forwarded on.

Well, they aren't. (I guess you're talking about the payload.) 
Unfortunately there's some issue with jabber servers that aren't fully
namespace aware. As the payload within BOSH typically has to be
classified as 'jabber:client' JabberHTTPBind currently removes the xmlns
attributes when forwarding those packets as the stream they are being
inserted to is classified as 'jabber:client'. 
Problems arise if you're sending packets to jabber components expect
packets of namespace 'jabber:component:accept'. Now a jabber server that
is not namespace aware would forward packets with namespace
'jabber:client' to the component if JabberHTTPBind wouldn't remove the
xmlns attribute.

Next thing is that parsing the stuff makes sure, that no invalid xml is
being forwarded. But maybe one could just skip that too?

Cheers, Steve

PS: If you need access to JHB's SVN repo contact me offlist to get the
required credentials.
PPS: There's also a trac site for JHB but I had to take it offline
because of massive spamming (...). If you think it could be useful I
could try to reactivate it again.

More information about the JDev mailing list