kafka-client-0.7.0.1: Low-level Haskell client library for Apache Kafka 0.7.

Safe HaskellNone
LanguageHaskell2010

Kafka.Internal.Request

Synopsis

Documentation

data Produce Source

A request to send messages down a Kafka topic-partition pair.

Produce requests do not have a corresponding response. There is no way of knowing in Kafka 0.7 if a message was successfully Produced.

Constructors

Produce 

Fields

produceTopic :: !Topic

Kafka topic to which the messages will be sent.

producePartition :: !Partition

Partition of the topic.

produceMessages :: [ByteString]

List of message payloads.

For those concerned with low-leveld details: These messages will be compressed using Snappy compression.

putProduceRequest :: Produce -> Put Source

Puts the given single Produce request.

putMultiProduceRequest :: [Produce] -> Put Source

Puts the given MultiProduce request.

data Fetch Source

A request to fetch messages from a particular Kafka topic-partition pair.

FetchResponse contains responses for this kind of request.

Constructors

Fetch 

Fields

fetchTopic :: !Topic

Kafka topic from which messages will be fetched.

fetchPartition :: !Partition

Partition of the topic.

fetchOffset :: !Offset

Offset at which the fetch will start.

Kafka offloads the responsiblity of knowing this to the client. That means that if an offset is specified here that is not a real message start, Kafka will spit out garbage.

Use offsets to find valid offsets.

fetchSize :: !Size

Maximum size of the returned messages.

Note, this is not the number of messages. This is the maximum combined size of the returned compressed messages.

Instances

putFetchRequest :: Fetch -> Put Source

Puts the given single Fetch request.

putMultiFetchRequest :: [Fetch] -> Put Source

Puts the given MultiFetch request.

data Offsets Source

A request to retrieve offset information from Kafka.

The response for this kind of request is a list of Offsets.

Constructors

Offsets 

Fields

offsetsTopic :: !Topic

Kafka topic from which offsets will be retrieved.

offsetsPartition :: !Partition

Partition of the topic.

offsetsTime :: !OffsetsTime

Time around which offsets will be retrieved.

If you provide a time for this, keep in mind that the response will not contain the precise offset that occurred around that time. It will return up to offsetsCount offsets in descending, each being the first offset of every segment file for the specified partition with a modified time less than the specified time, and possibly a "high water mark" for the last segment of the partition (if it was modified before the specified time) which specifies the offset at which the next message to that partition will be written.

offsetsCount :: !Count

Maximum number of offsets that will be retrieved.

putOffsetsRequest :: Offsets -> Put Source

Puts the given Offsets request.