Step 1 - move the data files
Place the new CSV files under an appropriate folder incvarc-application-tests/src/test/resources/data-samples/data/{AsOfDate}/. This example uses two files placed under the 2018-12-05 folder.
123_Custom_1.csv
987_Custom_2.csv
UselessData will be ignored — the topic’s parser column list (Step 3) determines which columns are read.Step 2 - define the store and a reference
Add the new store and any references to existing stores in theaddModifications() method of DatastoreCustomisationsConfig at cvarc-application/src/main/java/com/activeviam/cvarc/application/cfg/DatastoreCustomisationsConfig.java. This class lives in your project’s cvarc-application module and is intended to be edited directly.
Step 3 - define a publisher target, a source, and a topic
Create a new@Configuration class in cvarc-application/src/main/java/com/activeviam/cvarc/application/cfg/extensions/. It declares three DLC beans:
- a
TargetDescription— the publisher that writes parsed rows into the new store; - a
LocalCsvSourceDescription— the source that scans CSV files under a directory; - a
CsvTopicDescription— the topic that ties a file pattern to a parser and to the publisher target.
SASourceDescription (cvarc-starter/src/main/java/com/activeviam/cvarc/starter/cfg/impl/dlc/SASourceDescription.java) and TargetDescriptionsConfig (in the same package) for the canonical patterns.
columns(...) list determines which columns are read. Columns present in the file but absent from the list (e.g. UselessData) are skipped.
Step 4 - wire the extension into ApplicationConfig
AddCustomFileSourceDescription to the @Import list of ApplicationConfig in cvarc-application/src/main/java/com/activeviam/cvarc/application/cfg/ApplicationConfig.java.
Step 5 - register the topic for loading
A topic that has been declared but never registered for loading does nothing. There are two common ways to register it:Path A - initial-load via alias
AliasesDescriptionConfig (cvarc-starter/src/main/java/com/activeviam/cvarc/starter/cfg/impl/dlc/AliasesDescriptionConfig.java) groups topics under named aliases that InitialDataLoadConfig then loads at startup. Subclass it to append your new topic to an existing alias (or define a new one):
super.aliasesDescription().toBuilder() inherits every alias the parent declares; the additional .alias(...) call merges in the new topic. Add ExtendedAliasesDescriptionConfig to the @Import list of ApplicationConfig.
Path B - on-demand via data load controller
For loads triggered by an event or REST call rather than at startup, declare anApplicationRunner @Bean that calls the IDataLoadControllerService. Mirror InitialDataLoadConfig.initialDataLoad() (cvarc-starter/src/main/java/com/activeviam/cvarc/starter/cfg/impl/dlc/InitialDataLoadConfig.java):
dlc.execute(...) call can be invoked from any Spring component (e.g. a REST controller) to load data on demand.