You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Asankha C. Perera (JIRA)" <ji...@apache.org> on 2009/03/27 12:42:51 UTC

[jira] Resolved: (WSCOMMONS-454) SMTP transport can receive more than one message at same time

     [ https://issues.apache.org/jira/browse/WSCOMMONS-454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asankha C. Perera resolved WSCOMMONS-454.
-----------------------------------------

       Resolution: Fixed
    Fix Version/s: Transports 1.0

Now the mail transport supports both parallel processing as well as optional concurrent polling. This allows even the POP3 use case to process multiple messages at once.

The AbstractPollingTransport now understands an optional service level parameter:
        <parameter name="transport.ConcurrentPollingAllowed">false</parameter>

When set to true, polling will occur at the scheduled interval, even while previous polling runs have not completed. However, care has been taken not to process the same message twice, and was tested with both IMAP and POP3. [Note: Some POP3 servers may disable concurrent login to the same mailbox, and in such cases this option should not be used]

The mail transport understands an optional service level parameter:
        <parameter name="transport.mail.ProcessInParallel">true</parameter>

When set to true, each message is processed by a separate worker thread. With IMAP, logs shows that multiple messages are indeed even fetched - in parallel.

e.g. A digest log with IMAP

A44 FETCH 2 (BODY[TEXT]<0.16384>)
* 2 FETCH (BODY[TEXT]<0> {16384}
A45 FETCH 1 (BODY[TEXT]<0.16384>)
* 1 FETCH (BODY[TEXT]<0> {16384}
A46 FETCH 1 (BODY[TEXT]<16384.16384>)
* 1 FETCH (BODY[TEXT]<16384> {16384}
A47 FETCH 2 (BODY[TEXT]<16384.16384>)
* 2 FETCH (BODY[TEXT]<16384> {16384}

The code has been tested with IMAP and POP3 against Gmail, for all 4 scenarios the above two options now makes available.

> SMTP transport can receive more than one message at same time
> -------------------------------------------------------------
>
>                 Key: WSCOMMONS-454
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-454
>             Project: WS-Commons
>          Issue Type: Bug
>            Reporter: Amila Chinthaka Suriarachchi
>            Assignee: Asankha C. Perera
>            Priority: Blocker
>             Fix For: Transports 1.0
>
>
> hi all,
> recently I started some RM tests with the commons mail transport.
> Mail transport listener runs in a timer task.
> TimerTask timerTask = new TimerTask() {
>             @Override
>             public void run() {
>                  workerPool.execute(new Runnable() {
>                     public void run() {
>                          if (state == BaseConstants.PAUSED) {
>                             if (log.isDebugEnabled()) {
>                                 log.debug("Transport " + getTransportName() +
>                                         " poll trigger : Transport is currently paused..");
>                             }
>                         } else {
>                             poll(entry);
>                         }
>                         synchronized (entry) {
>                             if (!entry.canceled) {
>                                 schedulePoll(entry, pollInterval);
>                             }
>                         }
>                     }
>                 });
>             }
>         };
>         entry.timerTask = timerTask;
>         timer.schedule(timerTask, pollInterval)
> As I saw timer task only  re activates only after  earlier invocation finish. i.e  after completing the message.
> In RM inorder delivery case lets say we receive message number 2 before 1. then the initial thread does not return and
> it can not receive the message number 1.
> I tested this this the following sample.
> TimerTask timerTask = new TimerTask(){
>             public void run() {
>                 System.out.println("In the timer task");
>                 try {
>                     Thread.sleep(60000);
>                 } catch (InterruptedException e) {
>                     e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
>                 }
>                 System.out.println("Going out of timer task");
>             }
>         };
>         Timer timer = new Timer("Testtimer");
>         timer.schedule(timerTask,0, 1000);
> And I saw timer task does not run until it finishes the first task.
> Can we start a new thread to each new message? That is how earlier SMTP transport had done that.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.