Packages

Elsa is a full-featured Kafka library written in Elixir and extending the :brod library with additional support from the :kafka_protocol Erlang libraries to provide capabilities not available in :brod.

Current section

Files

Jump to
elsa lib elsa.ex
Raw

lib/elsa.ex

defmodule Elsa do
@moduledoc """
Provides public api to Elsa. Top-level short-cuts to sub-module functions
for performing basic interactions with Kafka including listing, creating,
deleting, and validating topics. Also provides a function for one-off
produce_sync of message(s) to a topic.
"""
import Record
defrecord :kafka_message, extract(:kafka_message, from_lib: "kafka_protocol/include/kpro_public.hrl")
defdelegate list_topics(endpoints), to: Elsa.Topic, as: :list
defdelegate topic?(endpoints, topic), to: Elsa.Topic, as: :exists?
defdelegate create_topic(endpoints, topic, opts \\ []), to: Elsa.Topic, as: :create
defdelegate delete_topic(endpoints, topic), to: Elsa.Topic, as: :delete
defdelegate produce(endpoints, topic, messages, opts \\ []), to: Elsa.Producer
defdelegate produce_sync(topic, messages, opts \\ []), to: Elsa.Producer
def fetch() do
end
def default_client(), do: :elsa_default_client
defmodule ConnectError do
defexception [:message]
end
end