Proxy support for AWS S3

You can provide proxy support for AWS S3 either through a workflow BP definition or using a property file.

A new property file, awss3.properties, is introduced to connect AWS S3 to the proxy server.

You can enter the requiredProxy attribute either through a workflow BP definition or using the property file. By default, the attribute is set to false in the property file. First, the system checks for value in the BP, if not present, then it takes the value from the property file.

Sample awss3.properties file:


##Mandatory. To be provided for testing with the proxy server.
##If connecting to proxy, set true else false
requiredProxy=false
##Host name of the proxy server
proxyHost=9.55.37.221
##Port number of the proxy server
proxyPort=1081
##Credentials for the proxy server
credentialsRequired=false
## User name to login to proxy server
userName=admin
## Password to login to proxy server
password=password
## Retry count
maxErrorRetryCount=3
#connectionTimeOut in ms
connectionTimeOut=10000
Note:
The parameter awss3.region is supported only in the business process definition. You must not add in the property file.
##Valid Values: 
us-gov-west-1,us-gov-east-1,us-east-1,us-east-2, us-west-1, us-west-2, eu-west-1, eu-west-2, eu-west-3, eu-central-1, eu-north-1,
ap-south-1, ap-southeast-1, ap-southeast-2 ,apnortheast-1 ,ap-northeast-2, sa-east-1, cn-north-1,cn-northwest-1, ca-central-1. 
##Note: These values are case-sensitive.
You need to add these lines to the existing AWS BP to enable the proxy support:

<assign to="awss3.region">us-east-1</assign>
<assign to="requiredProxy">true</assign>
<assign to="proxyHost">9.55.37.221</assign>
<assign to="proxyPort">1081</assign>
<assign to="credentialsRequired">false</assign>
<assign to="maxErrorRetryCount">3</assign>
<assign to="connectionTimeOut">10000</assign>
Sample GET BP with proxy:

<process name="AWSS3ClientGet">
  <sequence>
        <operation name="Extract File">
          <participant name='AWSS3Client'/>
          <output message='xout'>
            <assign to='action'>get</assign>
            <assign to="awss3.bucketname">dummyfoldername</assign>
            <assign to="awss3.filename">dummyfilename</assign>
            <assign to="awss3.accesskey">dummyaccesskey</assign>
            <assign to="awss3.secretkey">dummysecretkey</assign>
            <assign to="requiredProxy">true</assign>
            <assign to="awss3.region">dummyAWSRegion(case_sensitive: Enter in small case)</assign>
            <assign to="proxyHost">dummyproxyhost</assign>
            <assign to="proxyPort">dummyproxyport</assign>
            <assign to="credentialsRequired">dummycredentials</assign>
            <assign to="maxErrorRetryCount">dummyretrycount</assign>
            <assign to="connectionTimeOut">dummyconnectiontimeout</assign>
            <assign to='.' from='PrimaryDocument' />
          </output>
         <input message="xin">
           <assign to="." from="*"/>
         </input>
        </operation>
  </sequence>
</process>
Sample Put file from MBX to AWS S3 BP:


<process name="AWSS3ClientPUTFromMBXtoAWSS3">
  <sequence>
        <operation name="Extract File">
          <participant name='AWSS3Client'/>
          <output message='xout'>
            <assign to='action'>put</assign>
            <assign to='mbx.messageid'>dummymessageid</assign>
            <assign to="awss3.bucketname">dummyfoldername</assign>
            <assign to="awss3.filename">dummyfilename</assign>
            <assign to="awss3.accesskey">dummyaccesskey</assign>
            <assign to="awss3.secretkey">dummysecretkey</assign>
            <assign to="requiredProxy">true</assign>
            <assign to="awss3.region">dummyAWSRegion(case_sensitive: Enter in small case)</assign>
            <assign to="proxyHost">dummyproxyhost</assign>
            <assign to="proxyPort">dummyproxyport</assign>
            <assign to="credentialsRequired">dummycredentials</assign>
            <assign to="maxErrorRetryCount">dummyretrycount</assign>
            <assign to="connectionTimeOut">dummyconnectiontimeout</assign>
            <assign to='.' from='PrimaryDocument' />
          </output>
         <input message="xin">
           <assign to="." from="*"/>
         </input>
        </operation>
  </sequence>
</process>

Sample put file from Filesystem to AWS S3:


<process name="AWSS3ClientPut">
  <sequence>
        <operation name="Extract File">
          <participant name='AWSS3Client'/>
          <output message='xout'>
            <assign to='action'>put</assign>
            <assign to='source.path'>dummysourcepath</assign>
            <assign to="awss3.bucketname">dummyfoldername</assign>
            <assign to="awss3.filename">dummyfilename</assign>
            <assign to="awss3.accesskey">dummyaccesskey</assign>
            <assign to="awss3.secretkey">dummysecretkey</assign>
            <assign to="awss3.region">dummyAWSRegion(case_sensitive: Enter in small case)</assign>
            <assign to="requiredProxy">true</assign>
            <assign to="proxyHost">dummyproxyhost</assign>
            <assign to="proxyPort">dummyproxyport</assign>
            <assign to="credentialsRequired">dummycredentials</assign>
            <assign to="maxErrorRetryCount">dummyretrycount</assign>
            <assign to="connectionTimeOut">dummyconnectiontimeout</assign>
            <assign to='.' from='PrimaryDocument' />
          </output>
         <input message="xin">
           <assign to="." from="*"/>
         </input>
        </operation>
  </sequence>
</process>