mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trustin Lee" <trus...@gmail.com>
Subject Re: a question about SessionBuffer
Date Tue, 30 Oct 2007 13:12:35 GMT
You are right.  It's a known issue.  Please refer to the following issue:

https://issues.apache.org/jira/browse/DIRMINA-464

So you need to move the ProtocolCodecFilter behind ExecutorFilter, and
then ReadThrottleFilterBuilder will start to work.

HTH,
Trustin

On 10/29/07, tiandike <whtiandike@21cn.com> wrote:
>
> i add ReadThrottleFilterBuilder in my code ,but find it's invalid .
>
>
> my code is :
>  IoAcceptor acceptor = new SocketAcceptor(num,
> Executors.newCachedThreadPool());
>         IoAcceptorConfig config = new SocketAcceptorConfig();
>         config.setThreadModel(ThreadModel.MANUAL);
>         DefaultIoFilterChainBuilder chain = config.getFilterChain();
>        chain.addLast("codec",new ProtocolCodecFilter(new
> TextLineCodecFactory()));
>         chain.addLast("threadPool", new
> ExecutorFilter(Executors.newCachedThreadPool()));
>
>         UICReadThrottleFilterBuilder readThrottleFilterBuilder = new
> UICReadThrottleFilterBuilder();
>             readThrottleFilterBuilder.attach(chain);
>
>        acceptor.bind(new InetSocketAddress(PORT), new
> EchoProtocolHandler1(),
>                 config);
> ....................
>
>
> i find in sourcecode :
>  if (message instanceof ByteBuffer) {
>                 add(session, ((ByteBuffer) message).remaining());
>             }
>
> and at this time  message is not the instanceof ByteBuffer so add function
> will never be executed!
>
>
>
>
> Trustin Lee wrote:
> >
> > On 10/26/07, tiandike <whtiandike@21cn.com> wrote:
> >>
> >> I find in  ExecutorFilter   the request will  be wrapped in event and put
> >> in
> >> SessionBuffer.eventQueue field .
> >> If  my handler handle request slow  and client send request faster ,will
> >> the
> >> size of eventQueue  became huge and lead to OutofMemoryException error?
> >
> > Yes.  That's why you need to use ReadThrottleFilterBuilder.
> >
> > HTH,
> > Trustin
> > --
> > what we call human nature is actually human habit
> > --
> > http://gleamynode.net/
> > --
> > PGP Key ID: 0x0255ECA6
> >
> >
>
> --
> View this message in context: http://www.nabble.com/a-question-about-SessionBuffer-tf4695808s16868.html#a13463313
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>


-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Mime
View raw message