Folks

I think its time we revisited our HTTP model.

From what I understand there are a few issues. (mainly from talking to
Asankha who knows his stuff!)

1) The current HTTP client is very inefficient because it doesn't
reuse connections.

2) In the case of full WS-A (with "real" replyTos both coming in and
going out) we are probably ok - we shouldn't block any threads.

3) However, with non-WSA SOAP messages or with anonymous replyTos for
the outgoing message, we will block one thread per interaction waiting
for the server to respond. This is a big scalability problem.

There seem to be a number of approaches we can take:

a) We could use MINA directly and write our own HTTP handling code on
top of it. MINA has a very nice API but writing the HTTP code from
scratch will probably turn into a long-term project.

b) We could use AsyncWeb which is an HTTP system based on top of MINA.
(http://docs.safehaus.org/display/ASYNCWEB/Home). However, AsyncWeb
doesn't have a client (except for a bit of untouched code in sandbox).
We obviously need a client and server.

b2) We could use AsyncWeb as a server and contribute a better client
back to AsyncWeb. We'd still have to write the client, and we'd have
to hope they accepted it.

c) We could use HTTPCore [http://jakarta.apache.org/httpcomponents/httpcore/]
The latest HTTPCore has been updated to support NIO. It has both a
client and server. According to Asankha it has a pretty complex API,
which might be painful. On the plus side, Oleg - the main committer on
the NIO code - really knows his stuff and is very responsive and
active. As everyone in Apache knows, this can be a huge benefit.

There is also another key difference between AsyncWeb and HTTPCore
worth thinking about.

HTTPCore is designed to support streaming. In other words, it gives
control once data is available. AsyncWeb buffers the whole message in
memory before handing it over. The challenge here is a balance between
threads and memory. The asyncweb model will use fewer threads but more
memory. The HTTPCore model may cause our application threads to block
waiting on the network IO.

Of course the main concern for Synapse is not to block between sending
the request to the server and the server responding, and also to be
able to detach the incoming client socket from the thread.

I'm sure there are other points to be made, but this I think lays out
a few options.

Thoughts everyone!???

Paul


--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
[EMAIL PROTECTED]

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to