resumablejs-core-azure-storage-account
Service icon

ResumableJS Core - Azure Storage Account

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded
 on 17 December 2020
 by 
0.0
 (0 ratings)
resumablejs-core-azure-storage-account

ResumableJS Core - Azure Storage Account

Documentation
1.0.1

This component is part of a package. To use this component you will need to install all of the following components;

  • ResumableJS
  • ResumableJS Core - Azure Storage Account (this)


To use this component you will need to create the following configuration;

ResumableJS

In the ResumableJS widget that is used in the front-end you will need to use the following 2 values for the following properties:

  • UploadAPI
    • GetHostOrigin() + "/ResumableJSCoreAzureStorageAccount/rest/Resumable/incoming"
  • CompletionAPI
    • GetHostOrigin() + "/ResumableJSCoreAzureStorageAccount/rest/Resumable/markComplete"

For further instructions about setting up the front-end please read the ResumableJS documentation.

note: The Action GetHostOrigin is part of the ResumableJS component

ResumableJS Core - Azure Storage Account

To finalize the setup of this component you will need to configure at least 3 Site Properties. The following list goes into detail about all available Site Properties:

  • ApiKey (Required):
    • This is used for protecting your API from unwanted access. Please fill in a secure combination of characters. I recommend a GUID that can be created here
  • ConnectionStringIncomingBlobs (Required):
    • This is the connection string for the Storage Account that will host the chunks of the uploaded file. 
  • ContainerNameIncomingBlobs (Required):
    • This is the name of the Container that will host the chunks
  • FolderNameIncomingBlobs
    • All uploads can be placed in a "Folder" for ease of administration
  • ConnectionStringOutgoingBlobs
    • The connection string of the Storage Account that will host the stitched files. If this is empty, then the value ConnectionStringIncomingBlobs will be used.
  • ContainerNameOutgoingBlobs
    • The name of the container that will host the stitched files. If this empty then the value of ContainerNameIncomingBlobs will be used.
  • FolderNameOutgoingBlobs
    • All stitched files can be placed in a "Folder" for ease of administration. If this value is empty, then the value of FolderNameIncomingBlobs will be used.
  • AutomaticallyStitchFiles
    • Enable this to automatically start the stitch process when a file is uploaded.


Stitching process

This chapter will go into some details about the stitching process. 

After a file is completed (as indicated by the IsCompleted property of the ResumableFile entity) you can (automatically) start the stitching process by calling one of the StitchFile* Service Actions. It's recommended to use the Timer variants as stitching can take some time for extremely large files.

The timer is started by creating a record in the ResumableFileTimer entity. This entity will act as a queue should multiple files need to be stitched. A BPT proces will start on creation of the record and Wake the stitching timer. We are using this construction so that we only run the timer when needed and because a timer has the capability of waking itself when a timeout threshold has passed. 

The timer will query all the outstanding files ready for stitching and will then start appending outstanding chunks to the (if needed created) blob. Should this process take a long time then the timer will wake itself and stop the current proces. The new timer process will continue where the old one left of. In case of an error during the stitching process the error will be logged in both the timer record as well in the ResumableFile record. This file will then be excluded from further stitching. You will manually need to fix the error before being able to continue the stitching process.

The stitching itself is done entirely via the Storage Account. No data will transfer between the Azure Storage Account and your OutSystems platform. This results in the most speedy and efficient stitching process.

Note that the stitched blob is of a different type on the Storage Account then a regular blob. This should however not affect the normal operations on this blob.