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
--
*
*
*Confidentiality Disclaimer**: "The information contained in this
electronic message
(email) and any attachments to this email are intended
for the exclusive use of
the addressee(s) and access to this email by
anyone else is unauthorized. The
email may contain proprietary,
confidential or privileged information or
information relating to Integra
Group. If you are not the intended recipient,
please notify the sender by
telephone, fax, or return email and delete this
communication and any
attachments thereto, immediately from your computer. Any
dissemination,
distribution, or copying of this communication and the
attachments thereto
(in whole or part), in any manner, is strictly prohibited
and actionable at
law. The recipient acknowledges that emails are susceptible
to alteration
and their integrity cannot be guaranteed and that Company does
not
guarantee that any e-mail is virus-free and accept no liability for any
damage caused by any virus transmitted by this email."*