Azure Cloud Storage Enqueue and Dequeue

Enqueue

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

<MessageSource>
    <ValueChainId>9123</ValueChainId>
    <Name>AzureStorageInbox</Name>
    <SourceType> AZURE</SourceType>
    <Config>{protocol: 'https', accountName: 'MyAccountName', accountKey: 'MyAccountKey', rootDir: '/my/polleddir', share:'MyShareName' }</Config>
</MessageSource>

Dequeue

Dequeuing to Azure Cloud Storage is quite similar to Dequeue to file except for the MessageDestination specification.

A MessageDestination of DestinationType AZURE is used to configure the final destination for a message being dequeued to Azure Cloud Storage. For example:

<MessageDestination>
    <ValueChainId>9123</ValueChainId>
    <Name>AzureDestination</Name>
    <DestinationType>AZURE</DestinationType>
    <Config>{protocol: 'https', accountName: 'MyAccountName', accountKey: 'MyAccountKey', rootDir: '/my/polleddir', share:'MyShareName', fileNamePattern: '%{FileName}'}</Config>
</MessageDestination>

The Config is a JSON object containing:

JSON Objects

Required/Optional

Description

accountName

Required

Account Name provided by Azure Cloud Storage administrator.

accountKey

Required

Account Key provided by Azure Cloud Storage administrator.

share

Required

Share name provided by Azure Cloud Storage administrator.

rootDir

Required

Directory in Azure Cloud Storage in which file needs to be stored.

protocol

Optional

Default EndPoints Protocol for connecting to Azure Cloud Storage. Default value is https. Permitted values are http and https.

compressed

Optional

true to decompress the file while polling or compress while sending the file to Azure Cloud Storage.

fileNamePattern

Optional

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