Class PostgresqlAutoConfiguration
java.lang.Object
io.axoniq.framework.springboot.autoconfig.PostgresqlAutoConfiguration
@AutoConfiguration(afterName="io.axoniq.framework.springboot.autoconfig.AxonServerAutoConfiguration",
beforeName="org.axonframework.extension.springboot.autoconfig.JpaEventStoreAutoConfiguration")
@ConditionalOnClass(PostgresqlEventStorageEngine.class)
@EnableConfigurationProperties(PostgresqlProperties.class)
public class PostgresqlAutoConfiguration
extends Object
Autoconfiguration class for the Axon Framework PostgreSQL extension.
Note that the PostgresqlConfigurationEnhancer already sets this extension's defaults, like the
PostgresqlEventStorageEngine, through the service-loading mechanism. This autoconfiguration provides the
ability to disable the PostgresqlConfigurationEnhancer by setting the axon.postgresql.enabled
property to false, and to translate axon.postgresql.schema-initialization into the
SchemaInitialization the engine is constructed with.
- Since:
- 5.1.0
- Author:
- Steven van Beelen, John Hendrikx
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBean creation method for aConfigurationEnhancerthat disables thePostgresqlConfigurationEnhancerwhen theaxon.postgresql.enabledproperty is set tofalse.Bean creation method for aConfigurationEnhancertranslating theaxon.postgresql.schema-initializationproperty into theSchemaInitializationcomponent read by thePostgresqlConfigurationEnhancerwhen it constructs thePostgresqlEventStorageEngine.
-
Constructor Details
-
PostgresqlAutoConfiguration
public PostgresqlAutoConfiguration()
-
-
Method Details
-
disablePostgresqlConfigurationEnhancer
@Bean @ConditionalOnProperty(name="axon.postgresql.enabled", havingValue="false") public ConfigurationEnhancer disablePostgresqlConfigurationEnhancer()Bean creation method for aConfigurationEnhancerthat disables thePostgresqlConfigurationEnhancerwhen theaxon.postgresql.enabledproperty is set tofalse.- Returns:
- a configuration enhancer that disables the PostgreSQL configuration enhancer
-
postgresqlSchemaInitializationConfigurationEnhancer
@Bean @ConditionalOnProperty(name="axon.postgresql.enabled", matchIfMissing=true) public ConfigurationEnhancer postgresqlSchemaInitializationConfigurationEnhancer(PostgresqlProperties properties) Bean creation method for aConfigurationEnhancertranslating theaxon.postgresql.schema-initializationproperty into theSchemaInitializationcomponent read by thePostgresqlConfigurationEnhancerwhen it constructs thePostgresqlEventStorageEngine. Registration usesregisterIfNotPresent, so a component registered directly through theApplicationConfigureralways wins over this property translation.- Parameters:
properties- the boundPostgresqlProperties- Returns:
- a configuration enhancer registering the configured
SchemaInitialization
-