elsa v0.4.0 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, ordering by the timestamp attached to the message.

Retrieves an array of messages containing the supplied search string, sorted by time and with the partition and offset for reference. Search can be limited by an offset and time which are passed through to fetch_all/3 call retrieving the messages to search. By default, the search is applied against the message values but can be optionally switched to search on the message key by supplying the search_by_key: true option.

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_all(endpoints, topic, opts \\ [])
fetch_all(keyword(), String.t(), keyword()) :: list()

Retrieves all messages on a given topic across all partitions, ordering by the timestamp attached to the message.

Link to this function

search(endpoints, topic, search_term, opts \\ [])
search(keyword(), String.t(), String.t(), keyword()) :: list()

Retrieves an array of messages containing the supplied search string, sorted by time and with the partition and offset for reference. Search can be limited by an offset and time which are passed through to fetch_all/3 call retrieving the messages to search. By default, the search is applied against the message values but can be optionally switched to search on the message key by supplying the search_by_key: true option.