View Source KafkaEx.Messages.CreateTopics (kafka_ex v1.0.0-rc.1)
Represents the result of a CreateTopics API call.
This struct contains the results for all topics that were requested to be created, including any errors that occurred during creation.
Fields
topic_results- List ofTopicResultstructs, one for each topicthrottle_time_ms- Time in milliseconds the request was throttled (V2+)
Example
%CreateTopics{
topic_results: [
%TopicResult{topic: "my-topic", error: :no_error, error_message: nil},
%TopicResult{topic: "existing-topic", error: :topic_already_exists, error_message: "Topic already exists"}
],
throttle_time_ms: 0
}
Summary
Functions
Builds a CreateTopics struct from response data.
Returns the list of topics that failed to be created.
Returns the result for a specific topic.
Returns true if all topics were created successfully.
Returns the list of topics that were created successfully.
Types
@type t() :: %KafkaEx.Messages.CreateTopics{ throttle_time_ms: non_neg_integer() | nil, topic_results: [KafkaEx.Messages.CreateTopics.TopicResult.t()] }
Functions
Builds a CreateTopics struct from response data.
@spec failed_topics(t()) :: [KafkaEx.Messages.CreateTopics.TopicResult.t()]
Returns the list of topics that failed to be created.
@spec get_topic_result(t(), String.t()) :: KafkaEx.Messages.CreateTopics.TopicResult.t() | nil
Returns the result for a specific topic.
Returns true if all topics were created successfully.
@spec successful_topics(t()) :: [KafkaEx.Messages.CreateTopics.TopicResult.t()]
Returns the list of topics that were created successfully.