You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Diego Castillo <di...@inexbee.com> on 2003/01/29 18:53:43 UTC

RE : FIFO spool manager

Noel,

Thank you for the precise information. The JDBC spool does indeed
implement the FIFO behaviour that I require.

Maybe you can offer quick answers to some more questions:

1. How can a mailet retrieve the arrival timestamp of a mail? I guess
this information is contained in column "last_updated" of table "spool",
but I don't know how often it is overwritten.

2. My mailet uses MySQL for storing data. Can it benefit from the James'
DataSource handling? I am thinking in adding my DataSource configuration
to the James config file and get a reference to the object from within
my mailet.

3. How can my mailet find out the size of the spool and the outgoing
repositories?

Regards,


Diego

-----Message d'origine-----
De : Noel J. Bergman [mailto:noel@devtech.com] 
Envoyé : vendredi 24 janvier 2003 19:54
À : James Users List
Objet : RE: FIFO spool manager

Diego,

Interesting.  I am planning to re-visit the spooling mechanism for v3 to
allow other things, such as clustering.  So you have a requirement for
FIFO?

You would need to have a SpoolRepository subclass that ensures FIFO
behavior
for accept().  If you do it for James v2.x, the stable branch, the
package
is org.apache.james.services, but James v3 moves the spool interface to
org.apache.mailet.

However, I'm not sure that Steve is totally correct.  The JDBC spool
code
uses the message ID (see James.getId()) for the key.  getId() returns a
monotonically increasing value.  Although you might have to limit the
spool
threads to one, to ensure that processing finishes in a FIFO manner, a
quick
glance suggests that the JDBC spool should do what you want.

	--- Noel

-----Original Message-----
From: Diego Castillo [mailto:diego.castillo@inexbee.com]
Sent: Friday, January 24, 2003 5:24
To: james-user@jakarta.apache.org
Subject: FIFO spool manager


Hi all,

I have been using James for about a year now. I have been able to solve
most of my issues thanks to this mailing list. But I have one last issue
that I must solve if I want the project to be used in production: I need
the spool manager to be FIFO.

Steve Short told me back in August 7th 2002 that message keys are stored
in a HashSet (sorry, I couldn't find the mail on the archives). This
does not seem to have changed in 2.1, and I haven't heard about such a
functionality being considered for James 3. So I guess that I will have
to implement it myself.

Can anyone (Noel, Danny, Serge...) offer any directions so that I do not
get lost in the James code? Which objects should I look into first?

Any recommendations on how to implement this FIFO ordering?

When I will be finished, I plan heavy load tests. Hopefully my
modification won't make James crash, and I will be happy to submit it if
anyone is interested.


Diego


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: RE : FIFO spool manager

Posted by Serge Knystautas <se...@lokitech.com>.
Diego Castillo wrote:
> Noel,
> 
> Thank you for the precise information. The JDBC spool does indeed
> implement the FIFO behaviour that I require.
> 
> Maybe you can offer quick answers to some more questions:
> 
> 1. How can a mailet retrieve the arrival timestamp of a mail? I guess
> this information is contained in column "last_updated" of table "spool",
> but I don't know how often it is overwritten.

last_updated is updated with every write operation, so that wouldn't be 
accurate.  You'll want to parse the Received: header on the MimeMessage 
to see when it arrived.  They have a relatively standard format and 
hopefully you can deduce which is the most recent.

> 2. My mailet uses MySQL for storing data. Can it benefit from the James'
> DataSource handling? I am thinking in adding my DataSource configuration
> to the James config file and get a reference to the object from within
> my mailet.

I'm actually in the final stages of testing this on HEAD... switching 
from my hack mordred DB pool to DBCP, exposing a DataSource via JNDI, 
and changing all mailets and other database components to use this.

> 3. How can my mailet find out the size of the spool and the outgoing
> repositories?

There is no real way to get info on the size of the spools.  That's an 
interesting requirement, and it might be something worth exposing. 
Especially if we enforce FIFO (which I can't see why not), you could 
tell a management app that the ETD for a mail message is in "5 minutes" 
(like calling customer support).  Would be interesting, but I think it'd 
be outside the scope of the mailet API and just a feature of James.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org