[
https://issues.apache.org/activemq/browse/SM-855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38618
]
Juergen Mayrbaeurl commented on SM-855:
---------------------------------------
Remarks:
- I thought I'm not using tabs (sorry wrong Eclipse workspace used)
- You're right. The empty loop is very cpu intensive. Proposal for better
implementation of the non concurrent mode:
if (!workingSet.isEmpty()) {
try {
workingSet.wait();
} catch (InterruptedException e) {
}
}
workingSet.add(aFile);
if (log.isDebugEnabled()) {
log.debug("Scheduling file " + aFile + " for processing");
}
getExecutor().execute(new Runnable() {
public void run() {
try {
processFileAndDelete(aFile);
} finally {
workingSet.remove(aFile);
workingSet.notify();
}
}
});
Unfortunately I don't know how to get an executor with a single thread.
Therefore I can't implement the proposed better way. But I agree that it would
be better to do it with a single thread.
> Non concurrent processing of files in LW FilePoller
> ---------------------------------------------------
>
> Key: SM-855
> URL: https://issues.apache.org/activemq/browse/SM-855
> Project: ServiceMix
> Issue Type: Improvement
> Components: servicemix-components
> Affects Versions: 3.1
> Reporter: Juergen Mayrbaeurl
> Fix For: 3.1.1, 3.2
>
> Attachments: FilePoller.diff, FilePoller.diff
>
>
> LW FilePoller component always processes files concurrently. Sometimes it's
> very important that files get processed in a defined sequence, because the
> contents is depending on previously processed contents.
> I've extended the LW FilePoller class. It has a 'concurrent' property now
> (default is true) and properties for sorting the incoming files (Sort by name
> and last modification date, asc and desc)
> Maybe this functionality should be included in the LW FTP FilePoller and
> servicemix-file BC, too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.