milena-0.5.0.2: A Kafka client for Haskell.

Safe HaskellNone
LanguageHaskell2010

Network.Kafka.Producer

Contents

Synopsis

Producing

produce :: Handle -> ProduceRequest -> Kafka ProduceResponse Source #

Execute a produce request and get the raw produce response.

produceRequest :: RequiredAcks -> Timeout -> [(TopicAndPartition, MessageSet)] -> ProduceRequest Source #

Construct a produce request with explicit arguments.

produceMessages :: [TopicAndMessage] -> Kafka [ProduceResponse] Source #

Send messages to partition calculated by partitionAndCollate.

groupMessagesToSet :: [TopicAndMessage] -> MessageSet Source #

Create a protocol message set from a list of messages.

partitionAndCollate :: [TopicAndMessage] -> Kafka (Map Leader (Map TopicAndPartition [TopicAndMessage])) Source #

Group messages together with the leader they should be sent to.

getPartitionByKey :: ByteString -> Set PartitionAndLeader -> Maybe PartitionAndLeader Source #

Compute the partition for a record. This matches the way the official | clients compute the partition.

send :: Leader -> [(TopicAndPartition, MessageSet)] -> Kafka ProduceResponse Source #

Execute a produce request using the values in the state.

Messages

defaultMessageKey :: Key Source #

Default: Nothing

makeMessage :: ByteString -> Message Source #

Construct a message from a string of bytes using default attributes.

makeKeyedMessage :: ByteString -> ByteString -> Message Source #

Construct a message from a string of bytes using default attributes.