0
votes

I would like to poll amazon S3 bucket, consume file and remove it after consuming. I dragged S3 connector in mule studio and selected get-object-content as the operation.

Here is the effective flow --

<flow name="retry-from-s3" doc:name="get-from-s3">
    <s3:get-object-content config-ref="Amazon_S3" doc:name="Amazon S3" bucketName="my-bucket" key="my.file"/>
    <logger level="INFO" doc:name="Logger"/>
    <flow-ref name="do-something-with-it" doc:name="Flow Reference"/>
</flow>

When I run it ... it doesn't do anything. I am not sure how to set up polling interval. Also, can I consume and delete in one step just like we do for FTP and File based i/b endpoints.

Is this the right way of doing it should I be doing something else ? Any clues?

1

1 Answers

3
votes

To schedule the flow, the easiest way is to wrap it in a poll message source: http://www.mulesoft.org/documentation/display/current/Poll+Reference

Example:

<poll frequency="10000">
  <s3:get-object-content config-ref="s3" bucketName="my.bucket"
            key="my.file" />
</poll>

To delete the file, ou will need to manually delete the object when you're finished processing using:

<s3:delete-object config-ref="s3" bucketName="my.bucket"
            key="my.key" />