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