elsa v0.4.0 Elsa.Producer

Defines functions to write messages to topics based on either a list of endpoints or a named client.

Link to this section Summary

Functions

Write the supplied message(s) to the desired topic/partition via an endpoint list or named client. If no client or endpoint is supplied, the default named client is chosen. If no partition is supplied, the first (zero) partition is chosen. Value may be a single message or a list of messages. If a list of messages is supplied as the value, the key is defaulted to the binary "ignored" and understood to be ignored by the cluster. If message value is a list, it is expected to be a list of key/value tuples. Partition can be an integer corresponding to a specific numbered partition, or the atoms "random" or "md5". The atoms correspond to partitioner functions that will uniformely select a random partition from the total available partitions of the topic or assign an integer based on an md5 hash of the messages to be written respectively.

Link to this section Functions

Link to this function

produce(endpoints, topic, messages, opts \\ [])

Write the supplied message(s) to the desired topic/partition via an endpoint list or named client. If no client or endpoint is supplied, the default named client is chosen. If no partition is supplied, the first (zero) partition is chosen. Value may be a single message or a list of messages. If a list of messages is supplied as the value, the key is defaulted to the binary "ignored" and understood to be ignored by the cluster. If message value is a list, it is expected to be a list of key/value tuples. Partition can be an integer corresponding to a specific numbered partition, or the atoms "random" or "md5". The atoms correspond to partitioner functions that will uniformely select a random partition from the total available partitions of the topic or assign an integer based on an md5 hash of the messages to be written respectively.

Link to this function

produce_sync(topic, messages, opts \\ [])