Browse Source

update 优化 kafka 自动创建 topic 部分人副本数不够报错问题

疯狂的狮子Li 2 years ago
parent
commit
d5c976058a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      ruoyi-example/ruoyi-test-mq/src/main/resources/application.yml

+ 5 - 1
ruoyi-example/ruoyi-test-mq/src/main/resources/application.yml

@@ -33,8 +33,12 @@ spring:
     streams:
       properties:
         application.id: kafka-streams-id # 应用ID
+    # 以下配置均应该在 kafka 配置文件内编写 写到此处是为了方便调试
     properties:
-      auto.create.topics.enable: true # 开启自动创建话题功能,默认是false,根据需要设置
+      # 开启自动创建话题功能,默认是false,根据需要设置
+      auto.create.topics.enable: true
+      # 默认副本数 1 避免单机使用无法创建 topic
+      default.replication.factor: 1
 
 --- # rocketmq 配置
 rocketmq: