Configuration

EclipseStore Spring-Boot Configuration

The simplest way to configure your storage is by using the key/value pairs in a configuration file as described in the EclipseStore documentation.

Detailed Configuration

If you need more control or want to configure your storage in code, we provide a simple Configuration class which can be used as follows:

Demo configuration
import org.eclipse.store.storage.embedded.types.EmbeddedStorage;
import org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation;
import org.eclipse.store.storage.types.Storage;
...
@Configuration
@EnableEclipseStoreRepositories
public class DemoConfiguration extends EclipseStoreClientConfiguration
{
    @Override
    public EmbeddedStorageFoundation<?> createEmbeddedStorageFoundation()
    {
            return EmbeddedStorage.Foundation(Storage.Configuration(Storage.FileProvider(Path.of("demo-storage"))));
    }
}

The method createEmbeddedStorageFoundation could return a much more complicated EmbeddedStorageFoundation as described here in the EclipseStore documentation about configuration and foundations.

This also enables you to use multiple EclipseStore-Storages in one project. See the Dual storages demo.

Properties

In general properties from EclipseStore can be used. See EclipseStore - Properties.

Here the Spring-Data-Eclipse-Store-Properties are displayed (all must be prefixed with spring-data-eclipse-store):

context-close-shutdown-storage.enabled

If enabled, the application listens to the ContextClosedEvent and shuts the storage down if the restart of the spring-dev-tools is enabled (see Known issues and DevToolProperties)

Default: true

context-close-shutdown-storage.only-when-dev-tools

If this and context-close-shutdown-storage.enabled are true, the application listens to the ContextClosedEvent and shuts the storage down only if the spring-dev-tools are present in the ClassLoader (see Known issues)

Default: true