You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Kumaran Arul <AK...@woolworths.com.au> on 2007/10/22 09:39:08 UTC
TIMEOUT on messageReceieved
Hi
I have my business service method invoked from my messageReceived(IoSession session, Object message) of my implementation of the IoHandlerAdapter class.
How can I timeout my service call using MINA? Is using java.util.concurrent.ScheduledThreadPoolExecutor the only way to go?
Thanks
Arul Kumaran
Senior Java/J2EE developer/designer
Woolworths Limited
P 02 8885 7528
E akumaran@woolworths.com.au
1 Woolworths Way Bella Vista, NSW 2153
PO Box 8000 Baulkham Hills, NSW 2153
P PLEASE CONSIDER THE ENVIRONMENT BEFORE YOU PRINT THIS E-MAIL
***********************************************************
CAUTION: This email and files included in its transmission
are solely intended for the use of the addressee(s) and may
contain information that is confidential and privileged.
If you receive this email in error, please advise us
immediately and delete it without copying the contents
contained within. Woolworths Limited (including its group
of companies) do not accept liability for the views
expressed within or the consequences of any computer
viruses that may be transmitted with this email. The
contents are also subject to copyright. No part of it
should be reproduced, adapted or transmitted without the
written consent of the copyright owner.
***********************************************************
Re: TIMEOUT on messageReceieved
Posted by Trustin Lee <tr...@gmail.com>.
On 10/22/07, Kumaran Arul <AK...@woolworths.com.au> wrote:
> Hi
>
>
> I have my business service method invoked from my messageReceived(IoSession session, Object message) of my implementation of the IoHandlerAdapter class.
>
> How can I timeout my service call using MINA? Is using java.util.concurrent.ScheduledThreadPoolExecutor the only way to go?
I think so. Be aware of OOM because SchduledThreadPoolExecutor holds
tasks until timeout comes even if they are all cancelled. You have to
purge them manually if you are processing many messages within short
timeframe.
HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6