During our tests we found that in some circumstances Mina server loses messages.
From what we understand this happens when client opens connection and then sends message(s) and the server is still busy processing the sessionOpened event while the message the client sent went through the server’s filterChain.
Attached is a simple client and server that will help you reproduce the problem, before you run it please perform the following steps:
- In order to reproduce the problem SSL filter must be defined (already implemented in the attached example)
- Update the keystore and truststore files locations in addSSLFilter() method in MinaClient and MinaServer
- Set server break points at:
- Set client break points at:
Since this is a timing problem you need to run a debugger as described below:
- Start server
- Start client
- At the client at MinaClientHandler#sessionOpened release the break point
- Release all break points server’s MinaServerHandler#sessionOpened
- After org.apache.mina.core.filterchain.IoFilter.NextFilter#messageReceived completed to process all events, you can release MinaServerHandler#sessionOpened
MinaServerHandler#messageReceived will be invoked with the message sent by the client
MinaServerHandler#messageReceived is not invoked.
To use the example, add the following jars to your class path:
The java we use is AdoptJDK 11.0.8