elsa v0.12.3 Elsa.Fetch

Provides functions for doing one-off retrieval of messages from the Kafka cluster.

Link to this section Summary

Functions

A simple interface for quickly retrieving a message set from the cluster on the given topic. Partition and offset may be specified as keyword options, defaulting to 0 in both cases if either is not supplied by the caller.

Retrieves all messages on a given topic across all partitions by default. Evaluates lazily, returning a Stream resource containing the messages. By default the starting offset is the earliest message offset and fetching continues until the latest offset at the time the stream is instantiated. Refine the scope of stream fetch by passing the start_offset and end_offset keyword arguments.

Retrieves a stream of messages for which the supplied function evaluates to true. Search can be limited by an offset which is passed through to the underlying fetch_stream/3 call retrieving the messages to search. All options for fetch_stream/3 are respected.

Retrieves a stream of messages where the keys contains the supplied search string. Search can be further limited by an offset which is passed through to the underlying fetch_stream/3 call retrieving the messages to search. All options for fetch_stream/3 are respected.

Retrieves a stream of messages where the values contains the supplied search string. Search can be further limited by an offset which is passed through to the underlying fetch_stream/3 call retrieving the messages to search. All options for fetch_stream/3 are respected.

Link to this section Functions

Link to this function

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

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

A simple interface for quickly retrieving a message set from the cluster on the given topic. Partition and offset may be specified as keyword options, defaulting to 0 in both cases if either is not supplied by the caller.

Link to this function

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

fetch_stream(keyword(), String.t(), keyword()) :: Enumerable.t()

Retrieves all messages on a given topic across all partitions by default. Evaluates lazily, returning a Stream resource containing the messages. By default the starting offset is the earliest message offset and fetching continues until the latest offset at the time the stream is instantiated. Refine the scope of stream fetch by passing the start_offset and end_offset keyword arguments.

Link to this function

search(endpoints, topic, search_function, opts \\ [])

search(keyword(), String.t(), function(), keyword()) :: Enumerable.t()

Retrieves a stream of messages for which the supplied function evaluates to true. Search can be limited by an offset which is passed through to the underlying fetch_stream/3 call retrieving the messages to search. All options for fetch_stream/3 are respected.

Link to this function

search_keys(endpoints, topic, search_term, opts \\ [])

search_keys(keyword(), String.t(), String.t(), keyword()) :: Enumerable.t()

Retrieves a stream of messages where the keys contains the supplied search string. Search can be further limited by an offset which is passed through to the underlying fetch_stream/3 call retrieving the messages to search. All options for fetch_stream/3 are respected.

Link to this function

search_values(endpoints, topic, search_term, opts \\ [])

search_values(keyword(), String.t(), String.t(), keyword()) :: Enumerable.t()

Retrieves a stream of messages where the values contains the supplied search string. Search can be further limited by an offset which is passed through to the underlying fetch_stream/3 call retrieving the messages to search. All options for fetch_stream/3 are respected.