在卡夫卡交易是什么意思?我当然知道普通的SQL事务:A transaction is a sequence of operations performed (using one or more SQL statements) on a database as a single logical unit of work
这是否意味着可以将某些内容发送到Kafka,如果出现问题,它将回滚(擦除分区中的消息?) 可以在事务中写不同的主题吗?
答案 0 :(得分:2)
Transactional Producer允许将数据发送到多个分区,并保证所有这些写操作都已提交或被丢弃。这是通过将对send()
(以及可选的sendOffsetsToTransaction()
)的多个调用分组到一个事务中来完成的。
交易开始后,您可以致电commitTransaction()
或abortTransaction()
完成交易。
配置为isolation.level=read_committed
的消费者将不会收到异常终止的消息。
有关更多详细信息,请检查文档中的Message Delivery Semantics section