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 li...@mitm.nl on 2006/04/28 18:43:51 UTC
Question about FromRepository and respooling
Hi,
I have a question about FromRepository and respooling messages from a queue.
I wonder what happens when a FromRespository is triggered multiple times.
Let's say I would like to respool messages from a specific directory.
Somehow the FromRepository has to be 'triggered' to start respooling. What
happens if I 'trigger' the FromRepository mailet again while the mailet is
respooling the messages? Because of the multithreaded nature of James I
would assume that another thread can call service() again while another
thread is respooling the messages. Messages are removed from the repository
when the complete respooling is finished. Isn't it possible that the second
thread starts sending some of the messages for a second time because
repository.list() still returns the message sent by the first thread?
Regards
Martijn Brinkers
Re: Question about FromRepository and respooling
Posted by Stefano Bagnara <ap...@bago.org>.
Currently the FromRepository read all the mails respooling them first ,
and then delete the mail in a second cycle.
So it will not work correctly if you call FromRepository twice.
And about locking the repository.retrieve method does not lock messages.
To support multiple concurrent calls we should change it to use
spoolrepository's accept method and to delete messages one at a time.
Otherwise adding a lock/delete should help...
Stefano
list@mitm.nl wrote:
> Hi,
>
>
>
> I have a question about FromRepository and respooling messages from a queue.
> I wonder what happens when a FromRespository is triggered multiple times.
> Let's say I would like to respool messages from a specific directory.
> Somehow the FromRepository has to be 'triggered' to start respooling. What
> happens if I 'trigger' the FromRepository mailet again while the mailet is
> respooling the messages? Because of the multithreaded nature of James I
> would assume that another thread can call service() again while another
> thread is respooling the messages. Messages are removed from the repository
> when the complete respooling is finished. Isn't it possible that the second
> thread starts sending some of the messages for a second time because
> repository.list() still returns the message sent by the first thread?
>
>
>
> Regards
>
>
>
> Martijn Brinkers
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org