Transactional Rollback Strategies with Spring Cloud Stream and Apache Kafka
Other parts in this blog series
Part 1: Introduction to Transactions in Spring Cloud Stream Kafka Applications
Part 2: Producer Initiated Transactions in Spring Cloud Stream Kafka Applications
Part 3: Synchronizing with External Transaction Managers in Spring Cloud Stream Kafka Applications
In the last three sections of this blog series, we analyzed how transactions work in Spring Cloud Stream Kafka applications. We encountered different contexts in which transactions are helpful, including both producer and consumer applications and how an application can correctly use them. Now that those fundamental elements are behind us, let’s move on to another aspect of transactions: rolling back a transaction when an error occurs. When an error occurs and a transactional system cannot commit the transaction, the transaction manager rolls back the transaction and does not persist anything for a downstream consumer to see. It would help if an application could dictate how this rollback mechanism works. Spring Cloud Stream facilitates this rollback…