I totally agree with you that, determining the completeness of the xml
documents will be the trickiest part. What I have in mind right now is that
in the TextLineDecoder once I encounter the root end tag </message>, find
the total number of occurances of <message> & </message> tags. If both are
one then assume it is a valid xml document and pass it  for Java binding.
Otherwise log it notify the client about the invalid message. Am I missing
anything here?
 

Emmanuel Lecharny-3 wrote:
> 
> 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
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/MINA---design-guidelines-tp20077627p20079337.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.

Reply via email to