milena-0.2.0.0: 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 preduce 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.

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

Execute a produce request using the values in the state.

brokerPartitionInfo :: TopicName -> Kafka [PartitionAndLeader] Source

Find a leader and partition for the topic.

Messages

defaultMessageKey :: Key Source

Default: Nothing

makeMessage :: ByteString -> Message Source

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