[ 
https://issues.apache.org/jira/browse/KAFKA-20097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18056233#comment-18056233
 ] 

Shally_Katariya commented on KAFKA-20097:
-----------------------------------------

I’m actively working on this issue and have changes in progress. A PR will 
follow.

> CREATE_TOPIC returns topic information if topic already exists
> --------------------------------------------------------------
>
>                 Key: KAFKA-20097
>                 URL: https://issues.apache.org/jira/browse/KAFKA-20097
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Jonah Hooper
>            Priority: Minor
>
> CREATE_TOPICS request currently checks whether a topic already exists before 
> creating one. If a topic with the same name already exists, it will return a 
> [TOPIC_ALREADY_EXISTS|https://github.com/apache/kafka/blob/62206cfc5461629818a34723fee7817b369a6f7e/clients/src/main/java/org/apache/kafka/common/protocol/Errors.java#L256]
>  error code. No other information in the 
> [CreateTopicsResponse|https://github.com/apache/kafka/blob/62206cfc5461629818a34723fee7817b369a6f7e/clients/src/main/resources/common/message/CreateTopicsResponse.json#L42]
>  is set if this topic already exists. 
> Some clients, may wish to create a topic and then do further work with the 
> some information contained within the CreateTopicsResponse. If the client 
> does not receive the `CreateTopicsResponse` (for example, do to a network 
> disconnect), they may issue another request to create the topics. Since the 
> topics already exist, they will receive `TOPIC_ALREADY_EXISTS` and no other 
> information about the topic. Hence a further `METADATA_REQUEST` will need to 
> be issued to discover the topicId (to be used for other requests). 
> To improve convenience, kafka should fill in the 
> [CreateableTopicResult|https://github.com/apache/kafka/blob/62206cfc5461629818a34723fee7817b369a6f7e/clients/src/main/resources/common/message/CreateTopicsResponse.json#L42]
>  if a topic already exists. Callers then do not need to issue another request 
> for metadata. This would make writing clients a bit simpler. 



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

Reply via email to