Skip to content

GH-1773 - Add suport for Couchbase - #1780

Open
Fezlight wants to merge 7 commits into
spring-projects:mainfrom
Fezlight:feat/GH-1773_add_couchbase_support
Open

GH-1773 - Add suport for Couchbase#1780
Fezlight wants to merge 7 commits into
spring-projects:mainfrom
Fezlight:feat/GH-1773_add_couchbase_support

Conversation

@Fezlight

Copy link
Copy Markdown
Contributor

Summary

A new events module created spring-modulith-events-couchbase. This module aim to support Couchbase database in a similar way as MongoDB module and also support Transactional.

Couchbase need collections and indexes to be manually created like JDBC-base implementation, so i added some information in appendix.

Fixes #1773

Next

I think a next way can be to auto-configure collections and indexes programmatically using Couchbase SDK like JDBC-based implementation "spring.modulith.events.jdbc.schema-initialization.enabled"

Known issue

There is an issue with the "bootstrapsApplication" test in couchbase epr module with transation propagation level REQUIRE_NEW not being supported for now (See in Scenario). I don't know if Spring modulith use this transaction propagation level somewhere else in the main module ?

java.lang.UnsupportedOperationException: Propagation level 'requires_new' has been specified which is not currently supported

	at org.springframework.data.couchbase.transaction.CouchbaseCallbackTransactionManager.handlePropagation(CouchbaseCallbackTransactionManager.java:227)
	at org.springframework.data.couchbase.transaction.CouchbaseCallbackTransactionManager.execute(CouchbaseCallbackTransactionManager.java:79)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
	at org.springframework.modulith.test.Scenario.lambda$stimulate$1(Scenario.java:169)
	at org.springframework.modulith.test.Scenario.lambda$stimulate$3(Scenario.java:183)
	at org.springframework.modulith.test.Scenario$When.awaitInternal(Scenario.java:415)
	at org.springframework.modulith.test.Scenario$When.andWaitForStateChange(Scenario.java:409)
	at example.ApplicationIntegrationTests.bootstrapsApplication(ApplicationIntegrationTests.java:106)

I will post an issue on spring-data-couchbase to discuss about this. I think it's planned but not already released
image

Fezlight added 7 commits July 25, 2026 18:49
Signed-off-by: FezLight <alex_se@hotmail.fr>
Signed-off-by: FezLight <alex_se@hotmail.fr>
Signed-off-by: FezLight <alex_se@hotmail.fr>
Signed-off-by: FezLight <alex_se@hotmail.fr>
…level

Signed-off-by: FezLight <alex_se@hotmail.fr>
Signed-off-by: FezLight <alex_se@hotmail.fr>
* @author Raed Ben Hamouda
* @author Cora Iberkleid
*/
@DirtiesContext

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed test v1 and v2 by destroying context to force auto-configuration to re-run and pick the right schema.

@@ -1,2 +1,2 @@
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
spring.datasource.url=jdbc:h2:mem:${random.uuid};DB_CLOSE_DELAY=-1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because H2 is not a test container instance, it will reuse it. To avoid this, i make database name random to force database recreation

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.

Add support for Couchbase database

1 participant