Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-20580

Camel-File: Polls never stop

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 3.14.10
    • None
    • camel-file
    • None
    • Unknown

    Description

      Hi.
      I've the following Camel route that never stops, even on shutdown:

      from(buildSourceEndpointUri())
      .routeId("selection-files")
      .process(processor)
      .to(buildTargetSftpEndpoint().toString())
      .log(DEBUG, "Selection file '${header:" + FILE_PATH + "}' uploaded to the FTS server");
      

      where, `buildSourceEndpointUri` contains:

      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();
      

      and, on shutdown, I can see:

      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.

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cdprete-six Cosimo Damiano Prete
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: