benjak135765 commented on issue #12804:
URL: https://github.com/apache/apisix/issues/12804#issuecomment-3734262445

   # Bug Report: Kafka Logger Plugin - UnsupportedVersionException with Kafka 
4.1.1
   
   ## Environment
   - **APISIX Version**: 3.14.1
   - **Kafka Version**: 4.1.1 (Apache Kafka, deployed via Strimzi)
   - **Plugin**: kafka-logger
   
   ## Issue Description
   The kafka-logger plugin fails to send logs to Kafka 4.1.1 with an 
`UnsupportedVersionException`. The error indicates that the plugin is using 
Produce API version 1, which is not supported by Kafka 4.1.1.
   
   ## Error Logs
   
   ### APISIX Log
   ```
   2026/01/11 08:44:57 [error] 58#58: *214228 [lua] producer.lua:268: buffered 
messages send to kafka err: closed, retryable: true, topic: kafka-logger, 
partition_id: 0, length: 1, context: ngx.timer, client: 10.128.0.1, server: 
0.0.0.0:9080
   ```
   
   ### Kafka Broker Log
   ```
   2026-01-11 16:36:07 ERROR 
[data-plane-kafka-network-thread-0-PLAIN-9092-PLAINTEXT-5] Processor:79 - 
Exception while processing request from 10.128.3.30:9092-10.128.1.35:37478-5-38
   org.apache.kafka.common.errors.UnsupportedVersionException: Received request 
for api with key 0 (Produce) and unsupported version 1
   ```
   
   ## Expected Behavior
   The kafka-logger plugin should successfully send logs to Kafka 4.1.1 brokers.
   
   ## Actual Behavior
   The plugin fails to send logs, and the Kafka broker rejects the request due 
to unsupported API version.
   
   ## Steps to Reproduce
   1. Deploy APISIX 3.14.1
   2. Deploy Kafka 4.1.1 (via Strimzi in this case)
   3. Configure kafka-logger plugin on a route
   4. Send requests to the route
   5. Check APISIX and Kafka logs
   
   ## Configuration
   Kafka logger plugin configuration (example):
   ```json
   {
     "producer_type": "async",
     "name": "kafka logger",
     "brokers": [
       {
         "host": "my-cluster-kafka-bootstrap.kafka.svc.cluster.local",
         "port": 9092
       }
     ],
     "include_resp_body": true,
     "kafka_topic": "kafka-logger",
     "batch_max_size": 1,
     "include_req_body": true
   }
   ```
   
   ## Additional Information
   - The issue appears to be related to the underlying `lua-resty-kafka` 
library version compatibility with Kafka 4.1.1
   - Kafka 4.1.1 may require a newer API version than version 1 for the Produce 
API
   
   ## Questions
   1. Is APISIX 3.14.1 compatible with Kafka 4.1.1?
   2. What version of `lua-resty-kafka` does APISIX 3.14.1 use?
   3. Is there a workaround or configuration to make it compatible?
   4. Are there plans to update the Kafka client library to support newer Kafka 
versions?
   
   


-- 
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]

Reply via email to