1 Reply Latest reply on Jun 29, 2017 6:24 AM by rhn-support-pchhabra

    Camel not deleted if file consumer is used with pollEnrich

    angelbaranda

      Hello everyone.

       

      I have a problem similar to this [ENTESB-5091] Camel markerFile not deleted if file consumer is used with pollEnrich and custom aggregation strategy - JB… .

       

       

      My piece of code is this:

         <route id="writeZip">

                  <from id="_from1" uri="direct:start"/>

                  <pollEnrich id="_pollEnrich1">

                      <simple>${header.pdfnow}</simple>

                  </pollEnrich>

                  <aggregate completionFromBatchConsumer="true"

                      completionSize="100" eagerCheckCompletion="true"

                      id="_aggregate1" strategyRef="zipAggregationStrategy">

                      <correlationExpression>

                          <constant>true</constant>

                      </correlationExpression>

                      <to id="_to3" uri="file:work/cbr/input/zip?fileName=any.zip"/>

                  </aggregate>

              </route>

      As a result the file remains locked and does not get moved to .camel/ folder .

       

      My environment . Windows 8 . Jboss Fuse (jboss-fuse-karaf-6.3.0.redhat-187). Deploy in Jboss Developer Studio Runtime Server.

       

      Do you have a solution?

      A workaround ?

       

      Thanks in advance.

      King regards .

       

      César

        • 1. Re: Camel not deleted if file consumer is used with pollEnrich
          rhn-support-pchhabra

          The bug has been marked "Not Fixed" in Fuse 6.2.1

           

          As a workaround you can try this:
          Certain properties of the resource Exchange need to be copied over to the original Exchange for the Camel markerFile to be deleted correctly.

          These properties are dynamic in their names but append Exchange.FILE_LOCK_FILE_ACQUIRED and Exchange.FILE_LOCK_FILE_NAME at the end of their names.

          E.g. 

          /Users/TestCases/poll-enrich-test/target/pollEnrich/enrich.txt-CamelFileLockFileAcquired
          /Users/TestCases/poll-enrich-test/target/pollEnrich/enrich.txt-CamelFileLockFileName 

          An alternative is to copy all properties of the resource Exchange to the original Exchange but this *may* overwrite existing Exchange properties.

          original.getProperties().putAll(resource.getProperties());