Last active
November 19, 2016 00:11
-
-
Save scott-kloud/89eb1b0f5deffdcfe0d3a87738851e09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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: "' + flowVars.config.anypointApplication + '" to Amazon S3 bucket: "' + flowVars.config.amazonS3Bucket + '"...']" 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