OCI Object Storage Enqueue and Dequeue

Enqueue

Enqueueing from OCI Object Storage is quite similar to File Enqueue except that the MessageSource is defined differently. For example:

<MessageSource>
    <ValueChainId>9123</ValueChainId>
    <Name>OCIObjectStorageInbox</Name>
    <SourceType>OCIObjectStorage</SourceType>
    <Config>{ accessKey: 'MyAccessKey', secretKey: 'MySecretKey', namespace: 'MyNamespaceName', bucketName: 'MyBucketName', rootDir: '/my/polleddir', region:'us-phoenix-1' }</Config>
</MessageSource>

Dequeue

Dequeuing to OCI Object Storage is quite similar to Dequeue to file except for the MessageDestination specification.

A MessageDestination of DestinationType OCIObjectStorage is used to configure the final destination for a message being dequeued to OCI Object Storage. For example:

<MessageDestination>
    <ValueChainId>9123</ValueChainId>
    <Name>OCIObjectStorageDestination</Name>
    <DestinationType>OCIObjectStorage</DestinationType>
    <Config>{accessKey: 'MyAccessKey', secretKey: 'MySecretKey', namespace: 'MyNamespaceName', bucketName: 'MyBucketName', rootDir: '/my/destdir', region:'us-phoenix-1', fileNamePattern: '%{FileName}'}</Config>
</MessageDestination>

The Config is a JSON object containing:

JSON Objects

Required/Optional

Description

accessKey

Required

Access key is provided by OCI Object Storage administrator.

secretKey

Required

Secret key is provided by OCI Object Storage administrator.

namespace

Required

Namespace name under which storage is created.

bucketName

Required

Bucket name provided by OCI Object Storage administrator.

rootDir

Required

Directory in OCI Object Storage which needs to be polled or in which file needs to be stored.

region

Required

OCI Object Storage region.

compressed

Optional

True to decompress the file while polling or compress while sending the file to OCI Object Storage.

fileNamePattern

Optional

fileNamePattern is an optional file name substitution pattern used when dequeuing messages in the OCI Object Storage 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.