A Kafka topic exists for each hotfolder. It receives a message when a new file is uploaded.

Description

Hotfolders are used to upload files to cenTaur. The folders are constantly monitored by the system for new files. For each hotfolder, there is also a topic in Kafka. If there is a new file, a message is published to the respective hotfolder topic. Other microservices, Node-RED nodes, or business logic function can subscribe to a certain hotfolder topic and react on new files.

Message

Field description

Fieldname

Description

messageTypeType of message, for example "ImportFileMessage".
versionThe version of this message format.
timestampTimestamp when this message was published to the message broker.
filesystemName of the filesystem (hotfolder) to which the files are uploaded. 
filesArray with the list of files that are uploaded to the hotfolder. In most cases, it contains only one file. There are use cases where more than one file is uploaded. For example, the content of a directory.
files/objectNameName of the file in the filesystem. The name can include path separators ("/").
files/isDirTrue if this file is a directory.
files/keyKey to reference the file. For example, if you call the File service to get a download URL.
files/urlSigned URL to download this file. This URL is valid for one week. The period starts with the value in the timestamp field.
lastModifiedLast modification timestamp of the file set. If the set contains exactly one file, this is the last modification date of that file. In case the set contains multiple files, it is the latest of all modification dates.

Example

{
  "messageType":"ImportFileMessage",
  "version":1,
  "timestamp":1612967718944,
  "filesystem":"hotfolder-test",
  "files":
    [
      {
        "objectName":"Abstract 1.jpg",
        "isDir":false,
        "key":"aG90Zm9sZGVyLXdlcm5lci9maWxlOkFic3RyYWN0IDEuanBnLyJlZ
WFhZWU0NWViMDAxODk5NjVhZjY2ZGQwYWFlMTkyNSI=",
        "url":"https://minio-docu.censhare.com/hotfolder-test/
Abstract%201.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&
X-Amz-Date=20210210T143518Z&X-Amz-SignedHeaders=
host&X-Amz-Expires=604800&X-Amz-Credential=
W3HJV23GCE8PS9LK7118%2F20210210%2Feu-central-1
%2Fs3%2Faws4_request&X-Amz-Signature=a80e46fff2702c
9bb74ec66db294b27a7f198252c7b356cd85972c2bbf5a70e3"
      }
    ],
  "lastModified":1612967715545
}

Configuration

A hotfolder topic is created with the following values:

ParameterValue
Partitions1
Replicas1