Hi,
it's quite simple: if the remote server does not receive anything, that
means your server does not send anything.
As it worked for a while, it's very likely something happened that
closed the connection.
* Have you received a sessionClosed() on your server?
* Have you checked on the network side if a FW is closing the connection
for any reason?
In any case, MINA is just behaving as expected, it's up to you to check
if the connection is not up and running wioth the remote serevr. that
means if you write a message and aren't receiving a messageSent for this
message after a while, thn you have to act accordingly.
On 24/10/2024 08:23, Nitin Phuria wrote:
Dear All,
We have developed one server using Apache MINA V2.1.6 where multiple
vendors connect and send the messages which needs to be processed and then
response have to be sent back to vendor. Currently we have put a strategy
that vendor has to send one message per connection and after getting
response or timeout vendor has to close the connection.
We also have persistance connection open from our MINA based server
with third party server whcih is tcp/ip channel and for each vendor request
we get we have to send the received message to this third party server. Past
3-4 days we have observed that application works fine for some time and then
suddenly all the messages written to session.write method does not go to
TCP/Ip and no Message sent event is generated for them. When I checked the
session's getWriteRequestQueue().size() it is observed that it is
continuously increasing only.
This operation is asynchronous; IoHandler.messageSent(IoSession, Object)
will be invoked when the message is actually sent to remote peer. In our
observation we found that the messageSent was not called once we observe the
WriteRequestQueue(). Size started building up.
When we checked with third party server they told they are not receiving any
messages on the port where we have opened persistence connection and they
are listening on it.
Any possible checks that we need to do at OS level or Network level which
can give us lead for the problem will help. If we restart our Server then
again for sometime it will work and then same problem of WriteQueue size
build up will start.
We have our own ProtocolCodecFactory implemented is used for
endocing/decoding messages from our server to third party server.
We have no executorFilter in the chain.
Below is my Protocol Encoder class
public class DefaultMyMsgEncoder extends ProtocolEncoderAdapter
{
public DefaultMyMsgEncoder()
{
}
public void encode(IoSession session, Object msg, ProtocolEncoderOutput
out) throws Exception
{
MyMsg myMsg = (MyMsg) msg;
IoBuffer buffer =
IoBuffer.allocate(myMsg.getLengthBytes().length+myMsg.getMsgBytes().length
);
buffer.put(myMsg.getLengthBytes());
buffer.put(myMsg.getMsgBytes());
buffer.flip();
out.write(buffer);
}
}
Thanks in advance.
Thanks And Regards,
Nitin Phuria
--
*Emmanuel Lécharny* P. +33 (0)6 08 33 32 61
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]