Skip to content

Template for running ActivePivot as a Spring Boot application

License

Notifications You must be signed in to change notification settings

activeviam/atoti-spring-boot-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Atoti Spring Boot Template

A minimalist Atoti project built with Spring Boot for you to edit, customize and use as a base for your Atoti Java projects.


📋 Details

This project aims to be an example of how to run Atoti as a Spring Boot application. Atoti was already a Spring application, but with the power of Spring Boot we can simplify our dependency management, deployment model, and many other goodies that come with Spring Boot.

This project is a starting point for your own projects and implementations. You should be able to take this, customize it and get a cube up and running in a few minutes.

📦 Installation

Requirements

  • Java 21
  • Maven 3
  • Atoti jar files (commercial software)
  • Lombok
  • Running the application requires a license for the Atoti software.

Clone or download this repository and run mvn clean install. This will generate a jar file, which can be run using standard java commands.

Note: If your build is unsuccessful, try skipping tests: mvn clean install -DskipTests

💻 Usage

Running the fat jar

The project contains, out of the box, an extremely simple datastore schema and small trades.csv file. You can find this file in src/main/resources/data.

java -jar ./target/atoti-spring-boot-template.jar
Running on macOS

Add the following argument -Dactiveviam.chunkAllocatorKey=mmap to your JVM, so it then becomes:

java -Dactiveviam.chunkAllocatorKey=mmap -jar ./target/atoti-spring-boot-template.jar

Note: If unable to start the Atoti Spring Boot application, you may need to add some additional arguments as well, try the following:

java --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -Dactiveviam.chunkAllocatorKey=mmap -jar ./target/atoti-spring-boot-template.jar

Running from the IDE

We provide 3 run configurations for IntelliJ Idea Ultimate:

  • AtotiSpringBootApplication (no OTEL): does not use the OpenTelemetry config, uses the application-local.yml.
  • AtotiSpringBootApplication OTEL: uses the OpenTelemetry config, uses the application.yml, start the OTEL stack else you will see some exceptions.
  • AtotiSpringBootApplication OTEL w/agent: uses the OpenTelemetry agent, this run config has -Dotel.javaagent.enabled=true which is part of this project.
    it sets a special bean openTelemetry defined in AtotiSpringBootApplication, in order to avoid a mismatch in the OpenTelemetry SDK configuration.
    Note that Atoti does already OpenTelemetry manual instrumentation, we are not supposed to start the OpenTelemetry Java agent which does the out-of-the-box instrumentation since Atoti does it already.
    We do this just in case you find yourself in this context.

Similarly, you can find the following run configurations that work with IntelliJ Idea CE:

  • AtotiSpringBootApplication (no OTEL) App
  • AtotiSpringBootApplication OTEL App
  • AtotiSpringBootApplication OTEL w/agent App

Connecting to the Atoti Server

The default security credentials are admin:admin, but can be modified in the application.yml file.
For a real production deployment you should probably use LDAP instead of hardcoding the users in the application.yml file.
It is also recommended that you change the JWT key pair in application.yml by running the class JwtUtil and generating a new key pair.

❤️ Using OpenTelemetry

Check this section for OpenTelemetry.

About

Template for running ActivePivot as a Spring Boot application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%