ID | IEP-130 |
Author | |
Sponsor | |
Created | 22.11.2024 |
Status | ACTIVE |
Spring Boot is one of the most popular Java frameworks for creating microservices and enterprise applications. Providing seamless integration will increase Apache Ignite adoption among Spring developers and enable better integration with existing Spring Boot applications.
Spring Boot auto-configuration attempts to automatically configure a Spring application based on the jar dependencies.
In the most simple, case, ignite-client requires only Ignite address to connect to, so Ignite bean initialization requires the following steps:
IgniteClient has the following properties:
All of the above properties must be configurable.
The suggested configuration prefix for this mode is “ignite.client”. Example of the application.properties:
ignite.client.addresses=127.0.0.1:10800 ignite.client.connectTimeout=5000 ignite.client.reconnectThrottlingPeriod=30000L
It will be also possible to set or override these properties by defining a custom configuration bean:
@Bean public IgniteClientPropertiesCustomizer customize() { return cfg -> { cfg.setConnectTimeout(100L); }; }
Currently, starting Apache Ignite in embedded mode requires a HOCON configuration file. This limitation is being addressed in IGNITE-22898 and must be resolved before Spring Boot integration with embedded mode can be implemented.
To run a multi-node cluster, it's required to define a node that does cluster initialization. To do that, I propose adding a property called "ignite.bootstrap.nodeName".
If "ignite.bootstrap.nodeName" is not defined, the cluster will not be automatically initialized. This approach allows for manual initialization by invoking "IgnitionManager.init()" on a specific node.
I propose keeping autoconfigure modules along AI code in the main AI repository. This is opposite to AI2 approach, where all `extension` modules were kept in a separate repository. Keeping them in the same repository makes it easier to maintain.
When autoconfigure modules have different versions from the AI module, it becomes difficult to determine which autoconfigure version to use. While the autoconfigure module itself typically doesn't undergo major changes between versions, other Spring modules, such as Spring Data, do.
Example of ignite configuring with same as AI versioning:
dependencies { implementation 'org.apache.ignite:ignite-autoconfigure:3.0.0' implementation 'org.apache.ignite:ignite-api:3.0.0' implementation 'org.apache.ignite:ignite-runner:3.0.0' }
The same for client:
dependencies { implementation 'org.apache.ignite:ignite-client-autoconfigure:3.0.0' implementation 'org.apache.ignite:ignite-client:3.0.0' }
// Links to various reference documents, if applicable.
// Links or report with relevant JIRA tickets.