Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 59191 invoked from network); 11 Oct 2005 07:01:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Oct 2005 07:01:49 -0000 Received: (qmail 31672 invoked by uid 500); 11 Oct 2005 07:01:48 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 31629 invoked by uid 500); 11 Oct 2005 07:01:47 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 31617 invoked by uid 99); 11 Oct 2005 07:01:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2005 00:01:47 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [193.74.65.221] (HELO linux.easyhost.be) (193.74.65.221) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2005 00:01:49 -0700 Received: (qmail 27877 invoked from network); 11 Oct 2005 09:01:21 +0200 Received: from localhost (127.0.0.1) by localhost with SMTP; 11 Oct 2005 09:01:21 +0200 Received: from 195.0.96.5 ([195.0.96.5]) by webmail.daune-consult.com (Horde MIME library) with HTTP; Tue, 11 Oct 2005 09:01:21 +0200 Message-ID: <20051011090121.z5hu336mwogs4g88@webmail.daune-consult.com> Date: Tue, 11 Oct 2005 09:01:21 +0200 From: daune.jf@daune-consult.com To: dev@directory.apache.org Subject: Re: [Mina] Best to have prioritary messages MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > Hi Jean-Fran=E7ois, > > 2005/10/11, Jean-Fran=E7ois Daune : >> >> I face a tough problem. My server application needs to prioritize some >> messages. >> >> I mean that when a message of type X is received, it should be processed >> before any other ones. >> >> Actually, the best would be that a message X whose 'age' is higher than >> S seconds should be promoted as first one to process. >> >> In a way, it is QoS at message-handling level. >> >> What is the best way in Mina to implement this? > > > Yes, implementing a filter is the best solution as others noticed. Possib= ly > you'll have to implement your own ThreadPoolFilter or modify existing one= . > > BTW thanks for your good idea of QoS. :) > > Trustin > -- > what we call human nature is actually human habit > -- > http://gleamynode.net/ > I probably must clarify my need. Let's consider 100 opened sessions. On each session, if a message of type X= is received, I want it to be processed before Y seconds. I don't want to reorder messages received per session. Instead, when my server 'elects' the next session for processing, I want it= to first promote the sessions having a message X older than (Y-Z) seconds. I have checked BaseThreadPool, and if I understand well, I would need to change 'fetchBuffer' so that it first chooses SessionBuffer containing such messag= e. Is that correct? I am not sure as the difference between readySessionBuffers and busySessionBuffers does not appear clearly to me (why is a BufferSession ad= ded to busySessionBuffers in fireEvent?) Regards, J-F