Netty, candidate for a middleware?

96 views
Skip to first unread message

nocqu...@gmail.com

unread,
Feb 28, 2017, 3:40:46 PM2/28/17
to Netty discussions
Hi all

I am wondering if Netty could be a good candidate to build a middleware... I am new to Netty and asynchronous programming in general, so asking to experts ;)

I have 2 legacy applications, a webapp in java (soap-ws) and a legacy server (old-server) written in assembly which only speaks in TCP/IP. 
There are ~100 instances of soap-ws instances running and (i think) only one instance of the old-server (mainframe).
 
The schema is as follow: 

soap-ws (spring) ---->[HTTP] middleware (netty?) ---->[TCP/IP] old-server (assembly)

The soap-ws is blocking and also the old-server. Does it make sense to use Netty in the middle (which acts both as a server and a client)?

My understanding is that I could use a blocking http client from soap-ws (the request thread will wait a response and I am fine with that) to call the asynchronous middleware. Then the middleware will call the old-server in an asynchronous way, then the response will come from the old-server and will be transmitted to the blocking soap-ws client.

Another point, the old-server should probably manage the pressure from the asynchronous middleware (queue?).

So could Netty be a could candidate (its scalability looks promising)? Or should I stay with synchronous technologies (Tomcat/Spring) all the way long?

Thanks for your lights

--nick

Zhu Ran

unread,
Mar 1, 2017, 3:24:26 AM3/1/17
to Netty discussions
I have worked on a similar project and a simple answer to your question is YES.

Share some thoughts with you:
1. you should keep reqeust connections and use an ID to tag each connection
2.then you parse the original SOAP-WS request and translate it to HTTP request
3.tag this http request with the same ID with original request connection
4.you should send http request to the http server and wait the response
5.wrap the response to SOAP-WS response, find the original connection tagged via the ID
6.send back response through the connection, and then drop the connection

the IDs are used to find the original connections when Netty receives the http server's responses.
Because the thread to handle original request and the thread to send http request are not the same,
without the ID, a http response from http server would not find the original request connection.

Nicolas Ocquidant

unread,
Mar 1, 2017, 7:50:55 AM3/1/17
to Netty discussions
Thank you for your answer. You reinforce my choice.

Cheers
Reply all
Reply to author
Forward
0 new messages