Enqueue

Enqueueing from Amazon S3 is quite similar to File Enqueue except that the MessageSource is defined differently. For example:

<MessageSource>
<ValueChainId>9123</ValueChainId>
<Name>AmazonS3Inbox</Name>
<SourceType>AWSS3</SourceType>
<Config>{ accessKey: 'MyAccessKey', secretKey: 'MySecretKey', bucketName: 'MyBucketName', rootDir: '/my/polleddir', region:'us-east-1' }</Config>
</MessageSource>


Dequeue

Dequeuing to Amazon S3 is quite similar to Dequeue to file except for the MessageDestination specification.

A MessageDestination of DestinationType AWSS3 is used to configure the final destination for a message being dequeued to Amazon S3. For example:

<MessageDestination>
<ValueChainId>9123</ValueChainId>
<Name>AmazonS3Destination</Name>
<DestinationType>AWSS3</DestinationType>
<Config>{accessKey: 'MyAccessKey', secretKey: 'MySecretKey', bucketName: 'MyBucketName', rootDir: '/my/destdir', region:'us-east-1', fileNamePattern: '%{FileName}'}</Config>
</MessageDestination>
    
The Config is a JSON object containing:    
  • accessKey (required) – AWS access key provided by AWS administrator(IAM).

  • secretKey (required) – AWS secret key provided by AWS administrator(IAM).

  • bucketName (required) – Amazon S3 bucket name.

  • rootDir (required) – Directory in S3 bucket which needs to be polled or in which file needs to be stored.

  • region (required) – Amazon S3 region.

  • compressed (optional) – true to decompress the file while polling or compress while sending the file to S3.

  • fileNamePattern (optional) – fileNamePattern is an optional file name substitution pattern used when dequeuing messages in the Amazon S3 bucket i.e. %{fileName}.csv.

  • fileNamer (optional) - as an alternative to fileNamePattern, you can provide a fileNamer. Here you should give a groovy expression that evaluates to the desired value of the file name. The com.onenetwork.platform.integ.msg.Message being dequeued will be bound under the name msg so you can use things like interface name, client file name, etc. to help you generate the final file name.

    Example:

    fileNamer: 'msg.getOutboundInterface() + "." + System.currentTimeMillis() + ".csv"'

    or

    fileNamer: 'if ("ZBKS.BookLoad".equals(msg.getOutboundInterface())) { msg.getOutboundInterface() + "." + System.currentTimeMillis() + ".csv" } else { resolvedFileName }'

  • tempFileNamePattern (optional) – Same as of fileNamePattern except if provided, the file will be first streamed to the temp file name and then renamed to fileNamePattern.