[jira] [Created] (KAFKA-14973) Inconsistent treatment of invalid config when creating or altering a topic

2023-05-08 Thread James Shaw (Jira)
James Shaw created KAFKA-14973:
--

 Summary: Inconsistent treatment of invalid config when creating or 
altering a topic
 Key: KAFKA-14973
 URL: https://issues.apache.org/jira/browse/KAFKA-14973
 Project: Kafka
  Issue Type: Bug
  Components: admin
Affects Versions: 3.4.0
Reporter: James Shaw


{{createTopics}} throws {{InvalidConfigurationException}} on receiving an 
invalid config entry name or value.
{{incrementalAlterConfigs}} throws {{InvalidConfigurationException}} on 
receiving an invalid config entry name, but throws {{InvalidRequestException}} 
on receiving an invalid entry value.

The {{incrementalAlterConfigs}} javadoc mentions that 
{{InvalidRequestException}} is anticipated; the {{createTopics}} javadoc says 
nothing about exception types.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (KAFKA-14967) MockAdminClient throws NullPointerException in CreateTopicsResult

2023-05-04 Thread James Shaw (Jira)
James Shaw created KAFKA-14967:
--

 Summary: MockAdminClient throws NullPointerException in 
CreateTopicsResult
 Key: KAFKA-14967
 URL: https://issues.apache.org/jira/browse/KAFKA-14967
 Project: Kafka
  Issue Type: Bug
  Components: clients
Affects Versions: 3.4.0
Reporter: James Shaw


Calling {{CreateTopicsResult.topicId().get()}} throws {{NullPointerException}}, 
while {{KafkaAdminClient}} correctly returns the topicId.


Test case to reproduce:

{code:java} 
import org.apache.kafka.clients.admin.Admin;
import org.apache.kafka.clients.admin.CreateTopicsResult;
import org.apache.kafka.clients.admin.MockAdminClient;
import org.apache.kafka.clients.admin.NewTopic;
import org.apache.kafka.common.Node;
import org.apache.kafka.common.Uuid;
import org.junit.jupiter.api.Test;

import java.util.Optional;
import java.util.concurrent.ExecutionException;

import static java.util.Collections.singletonList;

public class MockAdminClientBug {
@Test
void shouldNotThrowNullPointerException() throws ExecutionException, 
InterruptedException {
Node controller = new Node(0, "mock", 0);
try (Admin admin = new MockAdminClient(singletonList(controller), 
controller)) {
CreateTopicsResult result = admin.createTopics(singletonList(new 
NewTopic("TestTopic", Optional.empty(), Optional.empty(;
Uuid topicId = result.topicId("TestTopic").get();
System.out.println(topicId);
}
}
}
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)