Ask Me wrote:
I am neither a network programming expert nor have any experience with MINA before 
and would need to design & develop a system to communicate with a remote server 
(passing xml documents using TCP/IP)
The requirement is like this:
1. A remote server will open up a TCP/IP socket connection to our server at 
port 7500.
2. Xml documents will be send to our server. (Xml average size: 4K; Character set: utf-8; Max concurrent requests upto 5000 messages per second). 3. I have to read/parse/construct these xml documents and process them (database look-up and/or updates) The xml documents will not any size or termination characters. I would have to parse it based on the root element end tag.
The problem is that you may receive a portion of a line. I'm not sure that your XML parser will handle this. IMO, this will be the trickiest part of the server implementation.
4. Create an XML response and send it back to the 3rd party server
I am thinking of developing the Server side as follows:
1. Use MINA version 1.1.7 (Since it is stated as the latest stable version.)
You can also give a try to MINA 2.0.0-M3. Even if it's not stable, you will have better performances.
2. Extend TextLineDecoder to override doDecode() to determine the completion of 
a message by looking for the begin and end xml root element tags.
Hopefully, your end tag won't appear in a comment ...
3. From messageReceived() method
a) Convert the xml document into Java object using XMLBeans/JiXB.
b) Pass the Java object to appropriate Java command processing classes which 
will return the response object
c) Convert the response object to Xml message using XMLBeans/JiXB.
Do a minimal benchmark without mina to be sure that this part only is able to process 5000 req/s.

Otherwise, sounds correct to me.


--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to