kafka_ex v0.11.0 KafkaEx.New.KafkaExAPI View Source
This module interfaces Kafka through the New.Client implementation
This is intended to become the future KafkaEx API
Most functions here take a client pid as the first argument.
{:ok, client} = KafkaEx.New.Client.start_link()
KafkaEx.New.KafkaExAPI.latest_offset(client, "some_topic", 0)
Link to this section Summary
Functions
Returns the cluster metadata from the given client
Returns the current correlation id for the given client
Fetch the latest offset for a given partition
Set the consumer group name that will be used by the given client for autocommit
Get topic metadata for the given topics
Link to this section Types
Link to this section Functions
cluster_metadata(client)
View Sourcecluster_metadata(client()) :: {:ok, KafkaEx.New.ClusterMetadata.t()}
Returns the cluster metadata from the given client
correlation_id(client)
View Sourcecorrelation_id(client()) :: {:ok, correlation_id()}
Returns the current correlation id for the given client
latest_offset(client, topic, partition)
View Sourcelatest_offset(client(), topic_name(), partition_id()) :: {:error, error_atom()} | {:ok, offset()}
Fetch the latest offset for a given partition
set_consumer_group_for_auto_commit(client, consumer_group)
View Sourceset_consumer_group_for_auto_commit(client(), consumer_group_name()) :: :ok | {:error, :invalid_consumer_group}
Set the consumer group name that will be used by the given client for autocommit
NOTE this function will not be supported after the legacy API is removed
topics_metadata(client, topics, allow_topic_creation \\ false)
View Sourcetopics_metadata(client(), [topic_name()], boolean()) :: {:ok, [KafkaEx.New.Topic.t()]}
Get topic metadata for the given topics
Always calls out to the broker to get the most up-to-date metadata (and subsequently updates the client's state with the updated metadata). Set allow_topic_creation to true to allow the topics to be created if they don't exist