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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM