shotover / shotover-proxy

L7 data-layer proxy
https://docs.shotover.io
Apache License 2.0
87 stars 18 forks source link

KafkaSinkCluster transaction request routing #1760

Closed rukai closed 1 month ago

rukai commented 1 month ago

some info on transactions at the protocol level: https://cwiki.apache.org/confluence/display/KAFKA/Transactional+Messaging+in+Kafka

This PR adds a basic integration test for kafka transactions. In order to get this integration test to pass support routing logic for the following message types is added to KafkaSinkCluster:

To support this new routing logic I also had to add logic for fetching the transaction coordinator. The logic is very similar to finding the group coordinator since both are fetched through the FindCoordinator request. So I adjusted the find group coordinator logic to also support finding transaction coordinators.

Future work

Kafka transaction message types not tested or implemented by this PR:

In a follow up PR I will introduce more integration tests in an attempt to trigger a driver to send these requests. If I cannot find a way to send these requests I will assume that they are used for broker-broker communication and not used by clients.

codspeed-hq[bot] commented 1 month ago

CodSpeed Performance Report

Merging #1760 will not alter performance

Comparing rukai:kafka_transactions (97c6617) with main (902273d)

Summary

✅ 39 untouched benchmarks