View Source Elsa.Topic (Elsa.fi v2.2.0)

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 \\ [])

View Source
@spec 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)

View Source
@spec delete(
  keyword(),
  String.t()
) :: :ok | {:error, term()}

Deletes the supplied topic from the cluster.

Link to this function

exists?(endpoints, topic)

View Source
@spec exists?(
  keyword(),
  String.t()
) :: boolean()

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

Link to this macro

kpro_rsp(args \\ [])

View Source (macro)
Link to this macro

kpro_rsp(record, args)

View Source (macro)
@spec 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.