Преглед на файлове

Merge pull request #10234 from thalesmg/fix-kconsumer-label-rv50

docs(kafka_consumer): make specific labels for key/value encoding modes
Zaiming (Stone) Shi преди 2 години
родител
ревизия
2cca6b1d5d
променени са 2 файла, в които са добавени 29 реда и са изтрити 12 реда
  1. 27 10
      lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_kafka.conf
  2. 2 2
      lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_kafka.erl

+ 27 - 10
lib-ee/emqx_ee_bridge/i18n/emqx_ee_bridge_kafka.conf

@@ -629,21 +629,38 @@ emqx_ee_bridge_kafka {
             zh: "主题映射关系"
         }
     }
-    consumer_encoding_mode {
+    consumer_key_encoding_mode {
         desc {
-            en: "Defines how the key or value from the Kafka message is"
+            en: "Defines how the key from the Kafka message is"
                 " dealt with before being forwarded via MQTT.\n"
-                "<code>none</code> Uses the key or value from the Kafka message unchanged."
-                "  Note: in this case, then the key or value must be a valid UTF-8 string.\n"
-                "<code>base64</code> Uses base-64 encoding on the received key or value."
-            zh: "定义了在通过MQTT转发之前如何处理Kafka消息的键或值。"
-                "<code>none</code> 使用Kafka消息中的键或值,不改变。"
-                "  注意:在这种情况下,那么键或值必须是一个有效的UTF-8字符串。\n"
+                "<code>none</code> Uses the key from the Kafka message unchanged."
+                "  Note: in this case, then the key must be a valid UTF-8 string.\n"
+                "<code>base64</code> Uses base-64 encoding on the received key."
+            zh: "定义了在通过MQTT转发之前如何处理Kafka消息的 Key。"
+                "<code>none</code> 使用Kafka消息中的 Key 原始值,不进行编码。"
+                "  注意:在这种情况下,Key 必须是一个有效的UTF-8字符串。\n"
                 "<code>base64</code> 对收到的密钥或值使用base-64编码。"
         }
         label {
-            en: "Encoding Mode"
-            zh: "编码模式"
+            en: "Key Encoding Mode"
+            zh: "Key 编码模式"
+        }
+    }
+    consumer_value_encoding_mode {
+        desc {
+            en: "Defines how the value from the Kafka message is"
+                " dealt with before being forwarded via MQTT.\n"
+                "<code>none</code> Uses the value from the Kafka message unchanged."
+                "  Note: in this case, then the value must be a valid UTF-8 string.\n"
+                "<code>base64</code> Uses base-64 encoding on the received value."
+            zh: "定义了在通过MQTT转发之前如何处理Kafka消息的 Value。"
+                "<code>none</code> 使用Kafka消息中的 Value 原始值,不进行编码。"
+                "  注意:在这种情况下,Value 必须是一个有效的UTF-8字符串。\n"
+                "<code>base64</code> 对收到的 Value 使用base-64编码。"
+        }
+        label {
+            en: "Value Encoding Mode"
+            zh: "Value 编码模式"
         }
     }
 }

+ 2 - 2
lib-ee/emqx_ee_bridge/src/emqx_ee_bridge_kafka.erl

@@ -338,11 +338,11 @@ fields(consumer_opts) ->
             )},
         {key_encoding_mode,
             mk(enum([none, base64]), #{
-                default => none, desc => ?DESC(consumer_encoding_mode)
+                default => none, desc => ?DESC(consumer_key_encoding_mode)
             })},
         {value_encoding_mode,
             mk(enum([none, base64]), #{
-                default => none, desc => ?DESC(consumer_encoding_mode)
+                default => none, desc => ?DESC(consumer_value_encoding_mode)
             })}
     ];
 fields(consumer_topic_mapping) ->