-
Notifications
You must be signed in to change notification settings - Fork 37
Add Kafka documentation for empty topic consumer behavior and batched produce routing #1031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
7fa50fc
53e53d8
3fbe9bf
06c18a8
c53084e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -146,6 +146,38 @@ produce and fetch request counts: | |||||
| kafka.kafka_mesh.request.metadata_request: 8 | ||||||
|
|
||||||
|
|
||||||
| Step 8: Test high-volume producing with batched records | ||||||
| ******************************************************* | ||||||
|
|
||||||
| In production, Kafka producers often batch multiple records into a single | ||||||
| ProduceRequest to improve throughput. The mesh filter must correctly handle | ||||||
| these batched requests and route records to the appropriate upstream cluster. | ||||||
|
|
||||||
| Send multiple messages rapidly to the ``cherries`` topic (which routes to | ||||||
| cluster1 based on the ``c`` prefix). The producer will automatically batch | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied in c53084e |
||||||
| these into fewer requests: | ||||||
|
|
||||||
| .. code-block:: console | ||||||
|
|
||||||
| $ docker compose run --rm kafka-client /bin/bash -c " \ | ||||||
| for i in {1..20}; do \ | ||||||
| echo \"cherry message \$i\"; \ | ||||||
| done | kafka-console-producer --request-required-acks 1 --producer-property enable.idempotence=false --broker-list proxy:10000 --topic cherries" | ||||||
|
|
||||||
| Now verify that all 20 messages arrived at cluster1 by consuming directly | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied in c53084e |
||||||
| from the upstream: | ||||||
|
|
||||||
| .. code-block:: console | ||||||
|
|
||||||
| $ docker compose run --rm kafka-client \ | ||||||
| kafka-console-consumer --bootstrap-server kafka-cluster1:9092 --topic cherries --from-beginning --max-messages 20 | wc -l | ||||||
| 20 | ||||||
|
|
||||||
| This confirms that even though the producer may have batched the records into | ||||||
| multiple ProduceRequests, the mesh filter correctly routed all messages to the | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied in c53084e |
||||||
| appropriate cluster. This is critical for high-throughput production workloads. | ||||||
|
|
||||||
|
|
||||||
| .. seealso:: | ||||||
|
|
||||||
| :ref:`Envoy Kafka mesh filter <config_network_filters_kafka_mesh>` | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in c53084e