• Kafka事务奇怪的enable.idempotence属性


    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

    image

  • 相关阅读:
    最高的牛
    激光炸弹(二维前缀和)
    汉诺塔问题
    费解的开关
    Hamilton路径(模板题)
    大臣的旅费【树型dp + 求树最长链】
    [蓝桥杯2018初赛]全球变暖
    操作集景
    [蓝桥杯2018初赛]倍数问题
    一些数学公式
  • 原文地址:https://www.cnblogs.com/dgwblog/p/12352991.html
Copyright © 2020-2023  润新知