bzp2010 commented on code in PR #6995: URL: https://github.com/apache/apisix/pull/6995#discussion_r867579674
########## docs/zh/latest/pubsub/kafka.md: ########## @@ -0,0 +1,120 @@ +--- +title: Apache Kafka +keywords: + - APISIX + - Pub-Sub + - Kafka +description: This document contains information about the Apache APISIX kafka pub-sub scenario. +--- + +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--> + +## 连接至 Apache Kafka + +在 Apache APISIX 中连接 Apache Kafka 非常简单。 + +当前我们实现的功能较为简单,可以实现获取偏移量(ListOffsets)、获取消息(Fetch)的功能,暂不支持 Apache Kafka 的消费者组功能,无法由 Kafka 管理偏移量。 + +### 局限性 + +- 用户需要手动管理偏移量:可以由自定义后端服务存储,或在开始获取消息前通过 List Offset 命令获取,它可以使用时间戳获取起始偏移量,或是获取初始、末尾偏移量。 +- 单条指令仅可获取一个 Topic Partition 的数据:暂不支持通过单条指令批量获取数据 + +### 准备 + +首先,需要使用`protoc`将[通信协议](../../../../apisix/pubsub.proto)编译为特定语言 SDK,它提供指令和响应定义,即可通过 APISIX 以 WebSocket 连接至 Kafka。 + +协议中`sequence`字段用来关联请求与响应,它们将一一对应,客户端可以以自己需要的方式管理它,APISIX 将不会对其进行修改,仅通过响应体透传回客户端。 Review Comment: @tzssangglass fixed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
