HTTP Binding as External Component

I’‘m looking how to integrate Steve’'s HTTP Binding implementation with Jive Messenger. Options are Internal or External Component.

Internal component was reason why I was looking at having servlet in plugin. Problem there is that servlet will be available on same port as admin interface and needs admin authentication. This doesn’'t look like very good solution.

External Component is better solution. But I’'m still not clear on how it can be done. Weather sample is not quite applicable to the HTTP Bind. Is there any documentation on External Components coming. Even early draft would be great. I think a saw that mentioned somewhere as well as component.xml.

Miroslav

Hey Miroslav,

Currently there is no available documentation about external components. However, I’'m glad to answer any question that you may have in order to make this work.

I read url=http://www.jabber.org/jeps/jep-0124.htmlJEP-124[/url] and Steve’'s code and it seems to me that you can make this work even without external components support. In fact it could work without internal or external components support.

Creating a component (external or internal) means that the server is providing a new service using a new service JID. For instance, the weather component provides its service at the following address: weather.example.com. MUC service works under conference.example.com. In the case of HTTP binding you are not providing a new service JID (if I’‘m not wrong). This means that you can run Steve’'s code in any webserver+servlet container that you want. The JHBServlet will then create a new Socket and connect it with the XMPP server for each HTTP client.

Regards,

– Gato

To add to Gato’'s post, my recommendation would be to have a .war file that works as both a normal webapp and as a plugin. I can post some example code for this a bit later.

Regards,

Matt

Hi Gato,

Yes I know that I can use Steve’'s code as it is, as external servlet. Thing is that will open socket for each client session. My understanding of External Component (and advantage of it) that it will open only one socket and send everything through it, and routing will be done internally. This looks to me more efficient.

But I’‘m not sure that I can do it, because there is no separate JID (you are right there). I don’'t see rule for router on which routing of packets can be based. Those packets will look completely same as external one not coming from HTTP Bind.

So it seams that this can’'t be build as External or Internal Component. Too bad, I was hoping I can do some optimization and avoid sending packets through different sockets or sockets at all.

I read JEP-0114 and that was my understanding, but maybe I’'m just dreaming

Miroslav

Hey Miroslav,

I now see what you mean. For optimization reasons you are looking for a way to add native support the HTTP binding to the server. In which case the connection manager will be a logical entity rather than a physical entity.

So what you need is to write a plugin (not a component) and simulate what the SocketAcceptThread and SocketReadThread classes do and at the same time follow the JEP-124.

Regards,

– Gato

I’‘ve attached a plugin file that shows how to make a normal WAR also work as a plugin. This will let you bypass the permissions system. It’'s a bit of a hack so let me know if you have any questions about how it works.

To optimize packet flow, I would recommend that you setup a facade to send the actual packets. In normal WAR mode (in an app-server), it will make connections for each user. When installed as a plugin, it can send packets directly to the server using the server’'s API.

Another option that may be possible in the future – we’'ve been talking about a router protocol that would let a single connection act as many client connections to a server. This would be similar to the external component protocol except that the router would act on behalf of client connections instead of a component.

Regards,

Matt
WebappPlugin.java (3974 Bytes)