Klevr Product Documentation logo

Inbound Blob Stage

The Inbound Blob stage allows messages to be ingested into Integration Hub by monitoring an Azure Storage Account blob container for the creation of new files.

Stage Overview

The Inbound Blob stage allows messages to be ingested into Integration Hub by monitoring an Azure Storage Account blob container for the creation of new files.

Support for event-based triggering was added in Integration Hub v3.1.0.

Stage Definition File Location

All Inbound Blob stages are defined by creating an appropriately formatted JSON definition file in the following location:

interfaces
{businessUnitCode}
{domainCode}
{integrationName}
in
blob
{STAGE_NAME}.json

Stage JSON Definition File Format

The JSON definition file for an Inbound Blob stage is as follows:

{
  "name": "stage-name",
  "displayName": "Brief Stage Title",
  "description": "Brief description of the stage.",
  "enabled": "$env:STATUS_<INTEGRATION_NAME>",
  "source": "previous-interface",
  "concurrency": 10,
  "recurrence": {
    "interval": 10,
    "frequency": "Minute"
  },
  "externalStorageAccount": {
    "accountName": "scwfccesftpsta",
    "accessKey": "$env:EXTERNAL_STORAGE_ACCOUNT_ACCESS_KEY",
    "blobPath": "/customer1/Inbound/Orders/"
  },
  "filter": {
    "fileName": "CTPO",
    "fileSize": 0,
    "fileExtension": "txt"
  },
  "deduplicate": {
    "timeWindow": "HH:MM:SS",
    "schemaMessageId": "schemas/path/to/transform.liquid",
    "fileType": "json|xml|csv",
    "hasHeader": "true|false",
    "lineEnding": "windows|unix"
  },
  "preLogTransformSchemaFileName": "schemas/path/to/schema/schema-name.liquid",
  "preLogTransformSchemaType": "liquid|javascript",
  "preLogTransformFormat": "json|xml|csv"
}
PropertySub-PropertyDescription
nameThe name of the stage.
displayNameOptional (but highly recommended). A short (3 or 4 word) "display name" for the stage, used as a "title" of the stage in the Integration Hub Portal service's self-documentation capability.
descriptionOptional (but highly recommended). A brief (10 to 15 word) description of the stage, used as a brief description of the stage's purpose in the Integration Hub Portal service's self-documentation capability. For a more detailed explanation (when needed), use the stage markdown feature.
enabledOptional boolean flag (true or false). Default is true.

Generally set via a DevOps variable. Controls if the stage is deployed enabled or not.
sourceOptional. Name of the previous stage that acts as the trigger for the Inbound Blob stage.

If this property is defined, then the stage will not be triggered on blob uploads to this container - the stage will only run and look for matching files in the blob container when the relevant previous stage event occurs. See also the Required Input Format section below.

Alternatively, sources may be supplied, and an array of one or more source events can be subscribed to.
concurrencyOptional number of concurrent runs permitted for the stage. Default is 10.
recurrenceOptional. Required when source or sources is not set, otherwise, must not be present when source is set.
intervalThe frequency check value.
frequencyThe definition of the unit of frequency to check for incoming files. Supports Minutes.
externalStorageAccount
accountNameThe Azure Storage Account name.
accessKeyThe access key for the Azure Storage Account.
blobPathThe blob path on the Azure Storage Account to monitor for incoming files. The field can accept an LGA expression, e.g. @{concat('/containerName/path1/path2/', convertFromUtc(utcNow(), 'AUS Eastern Standard Time', 'yyyy/MM/dd'))} if required, should a non-static path need to be monitored.
filter
fileNameIf set, only ingest files that commence with the literal string segment provided. Does not support wildcards. The file name prefix matching is case insensitive. Ignored when source (or sources) is set.
fileSizeIf set, do not ingest files of zero bytes. Only supports a value of zero. Recommended that this be set to zero, so that files in the process of being uploaded are not retrieved. Ignored when source (or sources) is set.
fileExtensionIf set, only ingest files that have the specified file name extension. The file extension matching is case insensitive. Ignored when source (or sources) is set.
deduplicateInbound message de-duplication options, to allow incoming duplicate messages to be discarded.
timeWindowThe time window in which any duplicate payloads detected should be discarded. (Hours, minutes, and seconds.)
schemaMessageIdA filename that defines a Liquid transform, which will transform the received payload into a text string, which defines a unique ID for each message, allowing any duplicates of this unique ID received within the timeWindow to be discarded.
fileTypeOne of json, xml, or csv, defining the type of inbound file, so that the Liquid transform above can correctly handle the file transformation to the unique ID string. Only JSON, XML, and CSV files can be de-duplicated.
hasHeaderRequired if fileType is csv. Set to either true or false to indicate if the CSV file has a header row or not.
lineEndingRequired when using the deduplicate feature, and when the fileType is set to csv. Set to either windows or unix.

Defines if the Liquid transformation set by the deduplicate.schemaMessageId field (to transform the file into a unique ID value for the payload) should expect the CSV file being received to have Windows (\r\n) or Unix (\n) line endings.

Pre-Logging Transformation

This stage supports the optional pre-logging transformation feature using the following fields:

  • preLogTransformSchemaFileName
  • preLogTransformSchemaType
  • preLogTransformFormat

See the Pre-Logging Transformation for details.

Required Input Format

In the event that the source (or sources) property is used, so that the Inbound Blob stage is triggered based on an event, rather than an uploaded file in the Azure Storage Account, then any filter options are ignored. Instead, the stage will search for a specific file in the location defined by the externalStorageAccount options, based on the following required input format when triggering the stage via an event:

{
    "Filename": "filename.csv"
}

In the payload, filename.csv should be the name of the file that is expected in the Azure Storage Account's defined blobPath when the event is used to trigger the stage.

Last updated on