Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt

Use this file to discover all available pages before exploring further.

At application start-up, DirectQuery needs to feed the Aggregate providers and the hierarchies by querying the external database. Like for a non-DirectQuery application, the cube will be empty and queries will return empty results until this feeding is done. Starting the application can be done like this:
application.start();
It is also possible to start the application asynchronously and wait for the feeding to be done:
final CubeFeedingPromise cubeFeedingPromise = application.startAsync();
// Do something else during the cube feeding
cubeFeedingPromise.waitForCompletion();
In Spring it is recommended to do this feeding after the creation of all the beans. This can be done by registering a Spring CommandLineRunner:
@Component
public class FeedCubeCommandLineRunner implements CommandLineRunner {
  private final IApplication application;
  public FeedCubeCommandLineRunner(final IApplication application) {
    this.application = application;
  }
  @Override
  public void run(final String... args) {
    this.application.start();
    System.out.print("Application feeding completed");
  }
}