Skip to content

Commit abf05d2

Browse files
committed
Fix #430: Prevent "Connection unexpectedly closed" in reactive tests
This is an attempt to fix it, according to spring-projects/spring-data-r2dbc#810. Because it's not directly possible to reproduce the issue, we can try it and see if the issue occurs again.
1 parent 8e393d6 commit abf05d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

outbox-kafka-spring-reactive/src/test/java/one/tomorrow/transactionaloutbox/reactive/AbstractIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public static void setR2DBCProperties(DynamicPropertyRegistry registry) {
5454
registry.add("spring.r2dbc.pool.enabled", () -> "true");
5555
registry.add("spring.r2dbc.pool.initial-size", () -> "5");
5656
registry.add("spring.r2dbc.pool.max-size", () -> "10");
57+
// disable background disposal of idle connections, to prevent "Connection unexpectedly closed"
58+
registry.add("spring.r2dbc.pool.max-idle-time", () -> "-1");
5759
}
5860

5961
}

0 commit comments

Comments
 (0)