feat(pubsub): support kafka#7032
Conversation
a8eca0a to
ac25c0b
Compare
UpdateThere are still some test cases that have not been debug passed yet. |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| use t::APISIX 'no_plan'; |
There was a problem hiding this comment.
t/admin/upstream5.t we need a meaningful name
There was a problem hiding this comment.
@membphis This is just because the previous upstreamX test contains too many lines, and it does not point to the upstream scheme test of "Kafka", future upstream-related tests can also be added to this file (this test was moved here from t/node), which only tests whether the upstream in the Admin API can be created properly.
| -- string to int64 cdata numbers. | ||
| local function pb_convert_to_int64(src) | ||
| if type(src) == "string" then | ||
| return C.atoll(ffi.cast("char *", src) + 1) |
There was a problem hiding this comment.
Let's check src length to avoid out of bound
| @@ -42,6 +42,10 @@ In Apache APISIX, the most common scenario is handling north-south traffic from | |||
|
|
|||
| Currently, Apache APISIX supports WebSocket communication with the client, which can be any application that supports WebSocket, with Protocol Buffer as the serialization mechanism, see the [protocol definition](../../../apisix/pubsub.proto). | |||
There was a problem hiding this comment.
Let's update the path of definition. We should use absolute path as it's not in website
| title: Apache Kafka | ||
| keywords: | ||
| - APISIX | ||
| - Pub-Sub |
There was a problem hiding this comment.
Could we use PubSub like pubsub in other places?
There was a problem hiding this comment.
All Pub-Sub replaced to PubSub
|
|
||
| ### Limitations | ||
|
|
||
| - Offsets need to be managed manually |
There was a problem hiding this comment.
After rendering, these two lines are merged together...
|
|
||
| ### Prepare | ||
|
|
||
| First, it is necessary to compile the [communication protocol](../../../../apisix/pubsub.proto) as a language-specific SDK using the `protoc`, which provides the command and response definitions to connect to Kafka via APISIX using the WebSocket. |
There was a problem hiding this comment.
Let's update the path of definition. We should use absolute path as it's not in website
| oneof req { | ||
| CmdEmpty cmd_empty = 31; | ||
| CmdPing cmd_ping = 32; | ||
| CmdEmpty cmd_empty = 31; |
There was a problem hiding this comment.
We can remove cmd_empty which is test-only? Using cmd_kafka_fetch in pubsub.t is enough.
There was a problem hiding this comment.
@spacewander This would make the pubsub module test the relevant code that relies on kafka, and I'm not sure if I should do that.
There was a problem hiding this comment.
What about adding a comment to show that this cmd is test-only?
There was a problem hiding this comment.
After rechecking, I found that CmdEmpty has added a test-only flag.
apisix/apisix/include/apisix/model/pubsub.proto
Lines 35 to 39 in d955009
Co-authored-by: soulbird <[email protected]>

Description
Provide kafka implementation on pubsub framework.
Split from #6995
Checklist