David Ferguson created CAMEL-13254:
--------------------------------------

             Summary: Some File Consumer Parameters have a different behaviour 
when used with Poll Enrich
                 Key: CAMEL-13254
                 URL: https://issues.apache.org/jira/browse/CAMEL-13254
             Project: Camel
          Issue Type: Bug
          Components: camel-core, eip
    Affects Versions: 2.23.1
         Environment: Windows 7 Enterprise SP 1, Zulu Java Open JDK 1.8.0_192
            Reporter: David Ferguson


Using the following file route definition
{code:java}
from("file:data/inbox?fileName=File-1.txt" +
        "&charset=UTF-8" +
        "&preMove=Staging" +
        
"&move=Success/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}" +
        
"&moveFailed=Failed/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}"
)
        .log("Finished polling...");
{code}
results in the following behaviour:
 * File consumed from _inbox_ directory - OK
 * File pre-moved to _inbox/Staging_ directory for processing - OK
 * File moved to 
_inbox/Success_/_{color:#333333}${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}{color}_
 when processing finished successfully - OK

This functions as expected.

Using the *exact same URI definition* with the Content Enricher EIP 
_pollEnrich_ using the following route
{code:java}
from("timer:start?delay=1000")
        .pollEnrich()
        .simple("file:data/inbox?fileName=File-1.txt" +
                "&charset=UTF-8" +
                "&preMove=Staging" +
                
"&move=Success/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}" +
                
"&moveFailed=Failed/${file:name.noext}-${date:now:yyyyMMddHHmmssSSS}.${file:ext}"
        )
        .log("Finished polling...");
{code}
results in the following behaviour:
 * File consumed from _inbox_ directory - OK
 * File pre-moved to _inbox/Staging_ directory for processing - OK
 * File moved to 
_inbox/Staging/Success/-__{color:#333333}${date:now:yyyyMMddHHmmssSSS}{color}__/__{color:#333333}$\{file:name{color}__}_
 - NOT AS EXPECTED

As the behaviour differs even though the exact same URI is defined for the file 
consumers, I'd be inclined to regard this as unintended behaviour and thus a 
bug. What do you guys think?

This strange behaviour also seems to have been discussed here back in 2016:

[http://camel.465427.n5.nabble.com/PollEnrich-with-file-language-td5787380.html]

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to