Hi Stefano,

On 2/4/07, Stefano Bagnara <[EMAIL PROTECTED]> wrote:

Hi all,

I'm working on a mina based smtp delivery service prototype and given my
limited knowledge of MINA/SEDA I have some doubts about the best way to
manage this.

The key is that I have an outgoing mail queue (persistent) and I have to
manage the delivery of the  mails (and also the retries, but this is
probably not important).

The outgoing queue can be thousands or even millions mails, so I can't
simply push everything to mina and wait, but I have to push messages at
the needed rate, or otherwise pop them from mina when needed.


Right.  You could use embedded JMS provider or similar queue persistence
library in this case.

I guess the only parameter I can use is how many concurrent messages to
process and to push new messages only when a previous message processing
has been completed, is this right?


Right.

Is this a correct approach? Have you any hint?


You could use messageSent() event, or register IoFutureListener to
WriteFuture, which is returned whenever you call IoSession.write().  And,
you can always check the number of queued messages to be flushed by calling
IoSession.getScheduledWriteRequests().

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Reply via email to