首页 > 其他 > 详细

Kafka事务奇怪的enable.idempotence属性

时间:2020-02-23 18:35:02      阅读:557      评论:0      收藏:0      [点我收藏+]

KafkaProperties中配置没有发现配置参数

  • enable.idempotence 也就是说没有办法通过直接配置开启,也就无法使用事物,当然可以选择手动配置Kafka
@ConfigurationProperties(
    prefix = "spring.kafka"
)
public class KafkaProperties {
    private List<String> bootstrapServers = new ArrayList(Collections.singletonList("localhost:9092"));
    private String clientId;
    private final Map<String, String> properties = new HashMap();
    private final KafkaProperties.Consumer consumer = new KafkaProperties.Consumer();
    private final KafkaProperties.Producer producer = new KafkaProperties.Producer();
    private final KafkaProperties.Admin admin = new KafkaProperties.Admin();
    private final KafkaProperties.Streams streams = new KafkaProperties.Streams();
    private final KafkaProperties.Listener listener = new KafkaProperties.Listener();


但是 Spring Boot Kafka 听下面两个配置会自动开启幂等性


spring.kafka.consumer.isolation-level=read_committed
spring.kafka.producer.transaction-id-prefix=test

技术分享图片

Kafka事务奇怪的enable.idempotence属性

原文:https://www.cnblogs.com/dgwblog/p/12352991.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!