activeviam / pivot-spring-boot

Template for running ActivePivot as a Spring Boot application
Apache License 2.0
14 stars 5 forks source link

Pivot Spring Boot

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


❗❗❗ IMPORTANT ❗❗❗

From now on use https://github.com/activeviam/atoti-spring-boot-template instead of this repository.

📋 Details

This project aims to be an example of how to run ActivePivot as a Spring Boot application. ActivePivot 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

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.

Running on macOS

Add the following argument -Dactiveviam.chunkAllocatorClass=com.qfs.chunk.direct.allocator.impl.MmapDirectChunkAllocator to your JVM, so it then becomes:

java -Dactiveviam.chunkAllocatorClass=com.qfs.chunk.direct.allocator.impl.MmapDirectChunkAllocator -Dfile.trades=<absolute path of trades.csv> -jar <fat jar path>

Note: If unable to start the ActivePivot 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.chunkAllocatorClass=com.qfs.chunk.direct.allocator.impl.MmapDirectChunkAllocator -Dfile.trades=<absolute path of trades.csv> -jar <fat jar path>

Connecting to the ActivePivot

The default security credentials are admin:admin, but can be modified in the SecurityConfig class (we use Spring Security). You should change this before going into production.

It is also recommended that you change the JWT key pair in application.yaml by running the class JwtUtil and generating a new key pair.