Skip to main content

Overview

This operation will keep the listening stream open in the background. If a stream is opened on a directory, and that directory contains data, then the data will be loaded immediately when the stream is opened. Streams can be closed by using the STOP_LISTEN operation. The status of an open stream can be retrieved using the LIST_STATUS operation. The START_LISTEN operation can act on any fetching Topic.

Request

DlcStartListenRequest

KeyRequiredTypeDescription
topicsYSet<String>Set of topics or aliases.
topicOverridesSet<ILoadingTopicDescription>Topic overrides.
scopeIDlcScopeScope Parameters
branchStringThe branch to operate on.
performGcOnStartBooleanPerform a Garbage collection before the datastore transaction.
performGcOnCompletionBooleanPerform a Garbage collection after the datastore transaction.
sourceNameStringThe source name to operate on. See source to topic matching.
sourceTypeDlcSourceTypeThe source type to operate on. See source to topic matching.

Example:

DlcStartListenRequest.builder()
    .topics("Topic1", "Topic2") // Required
    .topicOverrides(Set.of(CsvTopicDescription.builder("TopicToOverride", "glob:file*.csv")...build()))
    .scope(DlcScope.of("ScopeKey1", "ScopeValue1"))
    .branch("BranchToLoadInto")
    .sourceName("NameOfSourceToUse")
    .sourceType(DlcSourceType.LOCAL_SOURCE)
    .build();

Response

DlcStartListenResponse

KeyTypeDescription
reportStartListenReportReport of what occurred during the START_LISTEN operation.
statusDlcStatusStatus of the DLC Operation.

StartListenReport

KeyTypeDescription
listenIdPerTopicMap<String, String>A unique identifier to the stream that was opened for each Topic.

DlcStatus

A simple enum to capture if the DLC request was executed.
KeyDescription
OKRequest was handled successfully.
ERRORRequest was not able to be performed correctly.

How it works

File source types

For file source types, the DLC will register a file listener and start listening on the specified topics. When the file watcher is notified of file updates, the DLC listen operation will execute a DLC LOAD operation to load the files that have been updated. This means that the listen operation will simply execute a LOAD operation on all file updates.