Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- produce :: Kafka m => Handle -> ProduceRequest -> m ProduceResponse
- produceRequest :: RequiredAcks -> Timeout -> [(TopicAndPartition, MessageSet)] -> ProduceRequest
- produceMessages :: Kafka m => [TopicAndMessage] -> m [ProduceResponse]
- produceCompressedMessages :: Kafka m => CompressionCodec -> [TopicAndMessage] -> m [ProduceResponse]
- prod :: Kafka m => ([TopicAndMessage] -> MessageSet) -> [TopicAndMessage] -> m [ProduceResponse]
- groupMessagesToSet :: CompressionCodec -> [TopicAndMessage] -> MessageSet
- partitionAndCollate :: Kafka m => [TopicAndMessage] -> m (Map Leader (Map TopicAndPartition [TopicAndMessage]))
- getPartitionByKey :: ByteString -> Set PartitionAndLeader -> Maybe PartitionAndLeader
- send :: Kafka m => Leader -> [(TopicAndPartition, MessageSet)] -> m ProduceResponse
- getRandPartition :: Kafka m => Set PartitionAndLeader -> m (Maybe PartitionAndLeader)
- defaultMessageCrc :: Crc
- defaultMessageMagicByte :: MagicByte
- defaultMessageKey :: Key
- defaultMessageAttributes :: Attributes
- makeMessage :: ByteString -> Message
- makeKeyedMessage :: ByteString -> ByteString -> Message
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
.
prod :: Kafka m => ([TopicAndMessage] -> MessageSet) -> [TopicAndMessage] -> m [ProduceResponse] Source #
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.
getRandPartition :: Kafka m => Set PartitionAndLeader -> m (Maybe PartitionAndLeader) Source #
Messages
defaultMessageCrc :: Crc Source #
Default: 1
defaultMessageMagicByte :: MagicByte Source #
Default: 0
defaultMessageKey :: Key Source #
Default: Nothing
defaultMessageAttributes :: Attributes Source #
Default: 0
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.