Hello group!

I have a problem with my MINA server concerning thepreservation of order of incoming requests of the same client. It is a TCP/IP server with a proprietary protocol underneath. Unfortunately the protocol does not provide any semantics to indicate any sequence/dependency between single messages. Nevertheless it is crucial for the application behind that the requests are processed in the exact order they arrive on the network. I am aware of the asynchronous nature of MINA and very happy with it in other parts of the application. But for this part it is quite challenging. As a first step I have tried to reduce the amount of threads used on server-side to one (each for the Acceptor and the Processor) like this: new NioSocketAcceptor(Executors.newSingleThreadExecutor(), new NioProcessor(Executors.newSingleThreadExecutor())); From the documentation I interpret this, that the first executor is in charge accepting new connection on the ServerSocketChannel and the second is in charge of running the Processor of the queued IOSessions. Unfortunately this solution does not work. I have setup a stress test monitoring the network traffic with WireShark. From there I see, that packages arrive at the server in correct order. But nearly immediately after start of the test the packages get out of order. I must also mention, that the processing time of a single request is significant with around 500ms up to several seconds.

What am I doing wrong? Any help is really appreciated.


Kind regards

Sebastian

Reply via email to