Skip to content

Instantly share code, notes, and snippets.

@scott-kloud
Last active November 19, 2016 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scott-kloud/89eb1b0f5deffdcfe0d3a87738851e09 to your computer and use it in GitHub Desktop.
Save scott-kloud/89eb1b0f5deffdcfe0d3a87738851e09 to your computer and use it in GitHub Desktop.
<flow name="logArchiverFlow">
<poll doc:name="Poll">
<fixed-frequency-scheduler frequency="${polling.frequency.hours}" timeUnit="HOURS"/>
<set-payload value="#['${log.achiver.config}']" mimeType="application/json" doc:name="Read config"/>
</poll>
<json:json-to-object-transformer returnClass="java.util.HashMap" doc:name="JSON to Object"/>
<set-variable variableName="configCollection" value="#[payload.config]" doc:name="Set configCollection flowVar"/>
<foreach collection="#[flowVars.configCollection]" counterVariableName="configCounter" doc:name="For Each item in Config">
<set-variable variableName="config" value="#[flowVars.configCollection[configCounter-1]]" doc:name="Set config flowVar"/>
<logger message="#['Archiving log files for CloudHub application: &quot;' + flowVars.config.anypointApplication + '&quot; to Amazon S3 bucket: &quot;' + flowVars.config.amazonS3Bucket + '&quot;...']" level="INFO" doc:name="Logger"/>
<flow-ref name="archiveLogFile" doc:name="archiveLogFile"/>
</foreach>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<logger level="ERROR" doc:name="Logger"/>
</catch-exception-strategy>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment