Skip to content

42talents/example-kafka-transactions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

  1. Start Kafka Containers docker compose up
  2. Set the kafka consumer isolation level as required by the scenario
  3. Start this application
  4. Use Swagger UI to create orders

Scenarios

Kafka listener with default transaction isolation read_uncommitted

Property spring.kafka.consumer.properties.isolation.level is set to read_uncommitted, the default. See also https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html#isolation-level

When executing POST /orders/createAndSend with the error input to true the system starts retrieving messages also the kafka transaction is not commited. Leaving the db with "NEW" and "DONE" orders.

Kafka listener with transaction isolation read_committed

Property spring.kafka.consumer.properties.isolation.level is set to read_committed. See also https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html#isolation-level

When executing POST /orders/createAndSend with the error input to true the system does not retrieve messages as the kafka transaction is not commited. Leaving the db with "NEW" orders only.

UI

About

Example for transactions with spring boot and kafka.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages