fix: kafka bridge schema

This commit is contained in:
Zaiming (Stone) Shi 2022-09-12 10:51:35 +02:00
parent f0e03086a6
commit e45c99bf79
2 changed files with 19 additions and 6 deletions

View File

@ -219,7 +219,7 @@ emqx_ee_bridge_kafka {
socket_nodelay {
desc {
en: "When set to 'true', TCP buffer sent as soon as possible. "
"Otherwise the OS kernel may buffer small TCP packets for a while (40ms by default)."
"Otherwise, the OS kernel may buffer small TCP packets for a while (40 ms by default)."
zh: "设置 true' 让系统内核立即发送。否则当需要发送当内容很少时,可能会有一定延迟(默认 40 毫秒)。"
}
label {
@ -294,12 +294,12 @@ emqx_ee_bridge_kafka {
max_batch_bytes {
desc {
en: "Maximum bytes to collect in a Kafka message batch. "
"Most of the Kafka brokers default to a limit of 1MB batch size. "
"EMQX's default value is less than 1MB in order to compensate "
"Most of the Kafka brokers default to a limit of 1 MB batch size. "
"EMQX's default value is less than 1 MB in order to compensate "
"Kafka message encoding overheads (especially when each individual message is very small). "
"When a single message is over the limit, it is still sent (as a single element batch)."
zh: "最大消息批量字节数。"
"大多数 Kafka 环境的默认最低值是 1MBEMQX 的默认值比 1MB 更小是因为需要"
"大多数 Kafka 环境的默认最低值是 1 MBEMQX 的默认值比 1 MB 更小是因为需要"
"补偿 Kafka 消息编码索需要的额外字节(尤其是当每条消息都很小的情况下)。"
"当单个消息的大小超过该限制时,它仍然会被发送,(相当于该批量中只有单个消息)。"
}

View File

@ -245,8 +245,21 @@ desc("config") ->
?DESC("desc_config");
desc(Method) when Method =:= "get"; Method =:= "put"; Method =:= "post" ->
["Configuration for Kafka using `", string:to_upper(Method), "` method."];
desc(_) ->
undefined.
desc(Name) ->
lists:member(Name, struct_names()) orelse throw({missing_desc, Name}),
?DESC(Name).
struct_names() ->
[
auth_gssapi_kerberos,
auth_username_password,
kafka_message,
producer_buffer,
producer_kafka_opts,
producer_mqtt_opts,
socket_opts,
producer_opts
].
%% -------------------------------------------------------------------------------------------------
%% internal