You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Søren Hilmer <sh...@itplus.dk> on 2003/10/23 23:06:06 UTC

[PATCH] RemoteDelivery support for multiple delayTimes

This patch implements multiple delayTimes in RemoteDelivery, for that to work 
SpoolRepository, and implementing classes has also been modified, as have the 
sqlResources.xml.

The format for each delayTime entry is <attempts*delaytime unit> attempts and 
unit are optional. Attempt is the number of times the delay is used. Unit is 
one of msec(s),sec(s),minute(s),hour(s),day(s).

maxRetries are made consistent with the total number of delaytime attempts by:
   Increasing the attempts of the last delay if maxRetries are larger.
   Increasing maxRetries if the totalnumber of attempts are larger
If either of these is done a log of the action are made.

It uses a new method in SpoolRepository: accept (AcceptFilter) to select the 
mail that should be processed next.

When/if this gets accepted I will of course produce a similar patch for the 
2.1fcs branch.

--S�ren

-- 
S�ren Hilmer, M.Sc.
R&D manager		Phone:	+45 70 27 64 00
TietoEnator IT+		Fax:	+45 70 27 64 40
Ved Lunden 12		Direct:	+45 87 46 64 57
DK-8230 �byh�j		Email:	soren.hilmer@tietoenator.com


Re: [PATCH] RemoteDelivery support for multiple delayTimes

Posted by Søren Hilmer <sh...@itplus.dk>.
On Friday 24 October 2003 21:47, Noel J. Bergman wrote:
> Søren,
>
> We might do some further tweaking, but I think you've got the right idea.
> The thought I have is that (down the road) some code might want to accept
> messages based upon other criteria, so we might want to enlarge upon our
> options there, possibly by using introspection.
>
> A few minor items:
>
>   (1) Could you submit against branch_2_1_fcs?

Yep, will do that.

>   (2) The spool is purely internal.  Let's
>       chance accept() to return the message.

Okay, I guess you want this for all three accepts. 

>   (3) Please see GenericRegexMatcher.java
>       for "correct" usage of the regex code
>       in a multithreaded environment.  We
>       need to compile as READ-ONLY, and
>       create a matcher in the executing
>       thread.

But is the regex done from muliple threads? Only if init() can be called from 
multiple threads, and at initialization time we are not particularly pressed 
by performance issues, so I did a synchronized (MATCHER) in the Delay 
constructor. But I have no problem doing it the other way.

I also discovered a minor mistake in my patch, as the new accept method 
implementation in JDBCSpoolRepository does not enforce the minimum delay set 
by WAIT_LIMIT, will fix that as well.

Expect a new patch tomorrow.

--Søren

>
> I'd like to get this change included in our next release.  The spooler has
> never been exposed to anyone, and there are only two calls in the codebase.
> The James code didn't follow the correct usage pattern for regex
> previously, but it is documented by the regex classes, as I discovered when
> trying to do some other things with them.
>
> 	--- Noel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org

-- 
Søren Hilmer, M.Sc.
R&D manager		Phone:	+45 70 27 64 00
TietoEnator IT+		Fax:	+45 70 27 64 40
Ved Lunden 12		Direct:	+45 87 46 64 57
DK-8230 Åbyhøj		Email:	soren.hilmer@tietoenator.com



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


RE: [PATCH] RemoteDelivery support for multiple delayTimes

Posted by "Noel J. Bergman" <no...@devtech.com>.
Søren,

We might do some further tweaking, but I think you've got the right idea.
The thought I have is that (down the road) some code might want to accept
messages based upon other criteria, so we might want to enlarge upon our
options there, possibly by using introspection.

A few minor items:

  (1) Could you submit against branch_2_1_fcs?
  (2) The spool is purely internal.  Let's
      chance accept() to return the message.
  (3) Please see GenericRegexMatcher.java
      for "correct" usage of the regex code
      in a multithreaded environment.  We
      need to compile as READ-ONLY, and
      create a matcher in the executing
      thread.

I'd like to get this change included in our next release.  The spooler has
never been exposed to anyone, and there are only two calls in the codebase.
The James code didn't follow the correct usage pattern for regex previously,
but it is documented by the regex classes, as I discovered when trying to do
some other things with them.

	--- Noel


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