Skip to content

yraydhitya/spring-kafka-data-jdbc-mysql-transactional-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project shows that saved entities in a Kafka listener is not rollbacked in tests.

By default, test transactions will be automatically rolled back after completion of the test.

This is true if the transactions happen in the test thread. Kafka listener is running in a container thread so transactions happen there are not rolled back.

Asked this question in Stackoverflow and already answered by Spring Kafka's contributor.

See https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/context/transaction/TransactionalTestExecutionListener.html See https://stackoverflow.com/questions/53995445/saved-entity-in-a-spring-kafka-listener-is-not-rollbacked-on-a-transactional-tes

About

Spring Boot Kafka JDBC MySQL transactional test

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages