title: Mule foreach : Splitter returned no results
body: <p>I get a list of files on amazon S3 and iterate over the list of files and process one file at a time. The corresponding flow is as follows --</p>
  
  <pre><code>&lt;flow name="process-from-s3" doc:name="process-from-s3"
      processingStrategy="synchronous"&gt;
      &lt;poll doc:name="Poll" frequency="${s3-poll-interval}"&gt;
          &lt;s3:list-objects config-ref="Amazon_S3" doc:name="Get List of files"
              accessKey="${s3-access-key}" secretKey="${s3-secret-key}"
              bucketName="${s3-read-bucket}" /&gt;
      &lt;/poll&gt;
      &lt;choice doc:name="Choice"&gt;
              &lt;foreach doc:name="For Each"&gt;
                  &lt;set-session-variable variableName="s3_file_name" value="#[payload.getKey()]" doc:name="Session Variable"/&gt;
                  &lt;logger message="From bucket ( ${s3-read-bucket} ), received the file #[s3_file_name]" level="INFO" doc:name="Logger"/&gt;
                  &lt;flow-ref name="process_s3_file" doc:name="Flow Reference"/&gt;
              &lt;/foreach&gt;
      &lt;/choice&gt;
  &lt;/flow&gt;
  </code></pre>
  
  <p>The flow works well, however it keeps on spitting the following log statements if there are no files found. </p>
  
  <pre><code>[03-06 21:52:05] WARN  Foreach$CollectionMapSplitter   
  [[myapp].connector.polling.mule.default.receiver.01]: Splitter returned no results. 
  If this is not expected, please check your split expression
  </code></pre>
  
  <p>How can I avoid this annoying log message. Should I wrap the foreach within a choice router that processes the foreach if there is atleast one element in the list. Any suggestions are welcome.</p>