Eslam Mohamed created KAFKA-18873: ------------------------------------- Summary: Incorrect error message for max.in.flight.requests.per.connection when using transactional producer. Key: KAFKA-18873 URL: https://issues.apache.org/jira/browse/KAFKA-18873 Project: Kafka Issue Type: Bug Components: clients Reporter: Eslam Mohamed Assignee: Eslam Mohamed
{code:java} KafkaProducerTest.testInflightRequestsAndIdempotenceForIdempotentProduces{code} {{Above unit test }}checks for configuration validation errors when instantiating a {{ProducerConfig}} with invalid properties. One of the assertions in this test "invalidProps4" is designed to validate the constraint that {{max.in.flight.requests.per.connection}} must be at most {{5}} when using a transactional producer. However, the error message thrown by the {{ProducerConfig}} constructor in this scenario is incorrect. * *Observed Behavior:* When {{max.in.flight.requests.per.connection}} is set to {{6}} for a transactional producer, the test expects an exception with the message: {{"Must set max.in.flight.requests.per.connection to at most 5 when using the transactional producer."}} Instead, the error message states: {{"Must set retries to non-zero when using the idempotent producer."}} * *Expected Behavior:* The error message should explicitly indicate the violation of the {{max.in.flight.requests.per.connection}} constraint for transactional producers: {{"Must set max.in.flight.requests.per.connection to at most 5 when using the transactional producer."}} The mismatch in the error message can lead to confusion for developers debugging the configuration error, as it incorrectly hints at a {{retries}} configuration issue instead of the actual {{max.in.flight.requests.per.connection}} issue. -- This message was sent by Atlassian Jira (v8.20.10#820010)