Skip to content

GH-924 - Allow configuring the database type for JDBC event publications - #1804

Open
AdzerKI wants to merge 1 commit into
spring-projects:mainfrom
AdzerKI:gh-924-configurable-database-type
Open

GH-924 - Allow configuring the database type for JDBC event publications#1804
AdzerKI wants to merge 1 commit into
spring-projects:mainfrom
AdzerKI:gh-924-configurable-database-type

Conversation

@AdzerKI

@AdzerKI AdzerKI commented Aug 20, 2026

Copy link
Copy Markdown

Closes #924.

JdbcEventPublicationAutoConfiguration.databaseType(…) unconditionally opens a database connection to detect the DatabaseType. That breaks application contexts that have to bootstrap without database access — most prominently CDS / JDK AOT cache training runs (-Dspring.context.exit=onRefresh), where Flyway and Liquibase already offer an opt-out.

This change introduces spring.modulith.events.jdbc.database-type. If set, the auto-configuration uses the configured type as is and never touches the DataSource; if not set, the previous detection via connection metadata applies unchanged.

Verified with the new unit tests (JdbcEventPublicationAutoConfigurationUnitTests) and the existing module test suite.

…event publications.

Introduces spring.modulith.events.jdbc.database-type to statically configure the DatabaseType. If set, the auto-configuration no longer opens a database connection to detect the type, which allows contexts without database access, such as CDS or AOT cache training runs, to bootstrap.

Signed-off-by: AdzerKI <silver_cat@list.ru>
@AdzerKI
AdzerKI force-pushed the gh-924-configurable-database-type branch from ccc6501 to d439a75 Compare August 21, 2026 20:31
@AdzerKI

AdzerKI commented Aug 21, 2026

Copy link
Copy Markdown
Author

Force-pushed: the commit now carries the DCO sign-off, so the check is green.

Two things came with it while the branch was open:

  • the new property is documented in the configuration table (src/docs/antora/modules/ROOT/pages/appendix.adoc), next to the other spring.modulith.events.jdbc.* entries;
  • @since corrected to 2.2, matching the current snapshot.

spring-modulith-events-jdbc is green locally: 1012 tests, no failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support option to disable external access during CDS training

1 participant