elsa v0.12.3 Elsa.Topic

Provides functions for managing and interacting with topics in the Kafka cluster.

Link to this section Summary

Functions

Creates the supplied topic within the cluster. Sets the number of desired partitions and replication factor for the topic based on the optional keyword list. If the optional configs are not specified by the caller, the number of partitions and replicas defaults to 1.

Deletes the supplied topic from the cluster.

Confirms or denies the existence of a topic managed by the cluster.

Returns a list of all topics managed by the cluster as tuple of topic name and number of partitions.

Link to this section Functions

Link to this function

create(endpoints, topic, opts \\ [])

create(keyword(), String.t(), keyword()) :: :ok | {:error, term()}

Creates the supplied topic within the cluster. Sets the number of desired partitions and replication factor for the topic based on the optional keyword list. If the optional configs are not specified by the caller, the number of partitions and replicas defaults to 1.

Link to this function

delete(endpoints, topic)

delete(keyword(), String.t()) :: :ok | {:error, term()}

Deletes the supplied topic from the cluster.

Link to this function

exists?(endpoints, topic)

exists?(keyword(), String.t()) :: boolean()

Confirms or denies the existence of a topic managed by the cluster.

Link to this macro

kpro_rsp(args \\ [])

(macro)
Link to this macro

kpro_rsp(record, args)

(macro)
Link to this function

list(endpoints)

list(keyword()) :: {:ok, [{String.t(), integer()}]} | {:error, term()}

Returns a list of all topics managed by the cluster as tuple of topic name and number of partitions.