milena-0.5.3.0: A Kafka client for Haskell.

Safe HaskellNone
LanguageHaskell2010

Network.Kafka.Producer

Contents

Synopsis

Producing

produce :: Kafka m => Handle -> ProduceRequest -> m 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 :: Kafka m => [TopicAndMessage] -> m [ProduceResponse] Source #

Send messages to partition calculated by partitionAndCollate.

produceCompressedMessages :: Kafka m => CompressionCodec -> [TopicAndMessage] -> m [ProduceResponse] Source #

Send compressed messages to partition calculated by partitionAndCollate.

groupMessagesToSet :: CompressionCodec -> [TopicAndMessage] -> MessageSet Source #

Create a protocol message set from a list of messages.

partitionAndCollate :: Kafka m => [TopicAndMessage] -> m (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 :: Kafka m => Leader -> [(TopicAndPartition, MessageSet)] -> m 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.