Prerequisites#
- Java 17
- Maven 3.x
- Spring Boot 3
Maven Configuration#
Apart from standard Spring Boot dependencies, you need to include spring-boot-starter-higson-runtime dependency,
available in Maven Central.
Add spring-boot-starter-higson-runtime dependency to pom.xml file:
|
|
Another needed dependency is the JDBC driver to the database of choice, e.g., h2, oracle, mssql, postgresql:
|
|
Properties#
With the above setup, all the configuration that is needed is application.yml file with database properties:
|
|
If required properties are not available, spring-boot-starter-higson-runtime will return an adequate message.
To configure external sources, you have to set comma separated list of external sources names and connection properties for each of them. You can do it by using the properties below.
|
|
Using Auto-Configured HigsonEngine#
After successfully configuring properties while starting the application, spring will create HigsonEngine bean available in the spring application context, then which can be injected anywhere:
|
|
Overriding Default Configuration#
To override default auto-configuration, you need to define HigsonEngine bean in the @Configuration class:
|
|
Existing auto-configured DataSource and HigsonRuntimeProperties can be used simply by injecting them:
|
|
Disabling Higson#
If you want to disable higson temporarily for some reason, you can do it with property higson.runtime.enabled set
to false.
|
|