Cosimo Damiano Prete created CAMEL-20580:
--------------------------------------------
Summary: Camel-File: Polls never stop
Key: CAMEL-20580
URL: https://issues.apache.org/jira/browse/CAMEL-20580
Project: Camel
Issue Type: Bug
Components: camel-file
Affects Versions: 3.14.10
Reporter: Cosimo Damiano Prete
Hi.
I've the following Camel route that never stops, even on shutdown:
{code:java}
from(buildSourceEndpointUri())
.routeId("selection-files")
.process(processor)
.to(buildTargetSftpEndpoint().toString())
.log(DEBUG, "Selection file '${header:" + FILE_PATH + "}' uploaded to the FTS
server");
{code}
where, `buildSourceEndpointUri` contains:
{code:java}
final StringBuilder builder = new StringBuilder();
builder.append("file:");
if(!getBaseDirectory().startsWith("/")) builder.append("/");
builder.append(getBaseDirectory());
builder.append("?recursive=true");
builder.append("&flatten=false");
builder.append("&startingDirectoryMustExist=true");
builder.append("&noop=true");
builder.append("&idempotent=true");
builder.append("&idempotentKey=${file:name}-${file:modified}");
builder.append("&greedy=true");
builder.append("&initialDelay=0");
builder.append("&antInclude=");
builder.append("*/");
builder.append(selectionSpace.getDir());
builder.append("/*.xml");
return builder.toString();
{code}
and, on shutdown, I can see:
{noformat}
2024-03-19 06:57:03,001 INFO
[org.apache.camel.impl.engine.DefaultShutdownStrategy:691] (Camel
(tsbulk-sftp-context) thread #272 - ShutdownTask) Waiting as there are still 1
inflight and pending exchanges to complete, timeout in 45 seconds. Inflights
per route: [selection-files = 1]
2024-03-19 06:57:48,007 WARN
[org.apache.camel.impl.engine.DefaultShutdownStrategy:249] (MSC service thread
1-7) Timeout occurred during graceful shutdown. Forcing the routes to be
shutdown now. Notice: some resources may still be running as graceful shutdown
did not complete successfully.{noformat}
Do you have any suggestions on why does this happen? Is it maybe a bug in the
version I'm using?
Regarding the directory under monitoring, there will be roughly 80 files
included by the Ant pattern and the app is basically idle after ca. 11:00 AM,
therefore there should be plenty of time to process those files and it's really
unacceptable that there are still some at 06:00 AM or so of the day after.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)