hw-kafka-client-5.0.0: Kafka bindings for Haskell
Safe HaskellNone
LanguageHaskell2010

Kafka.Consumer.Types

Contents

Description

Module holding consumer types.

Synopsis

Documentation

data KafkaConsumer Source #

The main type for Kafka consumption, used e.g. to poll and commit messages.

Its constructor is intentionally not exposed, instead, one should use newConsumer to acquire such a value.

Constructors

KafkaConsumer 

Fields

newtype ConsumerGroupId Source #

Consumer group ID. Different consumers with the same consumer group ID will get assigned different partitions of each subscribed topic.

See Kafka documentation on consumer group

Constructors

ConsumerGroupId 

Instances

Instances details
Eq ConsumerGroupId Source # 
Instance details

Defined in Kafka.Consumer.Types

Ord ConsumerGroupId Source # 
Instance details

Defined in Kafka.Consumer.Types

Show ConsumerGroupId Source # 
Instance details

Defined in Kafka.Consumer.Types

IsString ConsumerGroupId Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic ConsumerGroupId Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep ConsumerGroupId :: Type -> Type #

type Rep ConsumerGroupId Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep ConsumerGroupId = D1 ('MetaData "ConsumerGroupId" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'True) (C1 ('MetaCons "ConsumerGroupId" 'PrefixI 'True) (S1 ('MetaSel ('Just "unConsumerGroupId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype Offset Source #

A message offset in a partition

Constructors

Offset 

Fields

Instances

Instances details
Eq Offset Source # 
Instance details

Defined in Kafka.Consumer.Types

Methods

(==) :: Offset -> Offset -> Bool #

(/=) :: Offset -> Offset -> Bool #

Ord Offset Source # 
Instance details

Defined in Kafka.Consumer.Types

Read Offset Source # 
Instance details

Defined in Kafka.Consumer.Types

Show Offset Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic Offset Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep Offset :: Type -> Type #

Methods

from :: Offset -> Rep Offset x #

to :: Rep Offset x -> Offset #

type Rep Offset Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep Offset = D1 ('MetaData "Offset" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'True) (C1 ('MetaCons "Offset" 'PrefixI 'True) (S1 ('MetaSel ('Just "unOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

data OffsetReset Source #

Where to reset the offset when there is no initial offset in Kafka

See Kafka documentation on offset reset

Constructors

Earliest 
Latest 

Instances

Instances details
Eq OffsetReset Source # 
Instance details

Defined in Kafka.Consumer.Types

Show OffsetReset Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic OffsetReset Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep OffsetReset :: Type -> Type #

type Rep OffsetReset Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep OffsetReset = D1 ('MetaData "OffsetReset" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'False) (C1 ('MetaCons "Earliest" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Latest" 'PrefixI 'False) (U1 :: Type -> Type))

data RebalanceEvent Source #

A set of events which happen during the rebalancing process

Constructors

RebalanceBeforeAssign [(TopicName, PartitionId)]

Happens before Kafka Client confirms new assignment

RebalanceAssign [(TopicName, PartitionId)]

Happens after the new assignment is confirmed

RebalanceBeforeRevoke [(TopicName, PartitionId)]

Happens before Kafka Client confirms partitions rejection

RebalanceRevoke [(TopicName, PartitionId)]

Happens after the rejection is confirmed

Instances

Instances details
Eq RebalanceEvent Source # 
Instance details

Defined in Kafka.Consumer.Types

Show RebalanceEvent Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic RebalanceEvent Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep RebalanceEvent :: Type -> Type #

type Rep RebalanceEvent Source # 
Instance details

Defined in Kafka.Consumer.Types

data PartitionOffset Source #

The partition offset

Instances

Instances details
Eq PartitionOffset Source # 
Instance details

Defined in Kafka.Consumer.Types

Show PartitionOffset Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic PartitionOffset Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep PartitionOffset :: Type -> Type #

type Rep PartitionOffset Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep PartitionOffset = D1 ('MetaData "PartitionOffset" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'False) ((C1 ('MetaCons "PartitionOffsetBeginning" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PartitionOffsetEnd" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PartitionOffset" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)) :+: (C1 ('MetaCons "PartitionOffsetStored" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PartitionOffsetInvalid" 'PrefixI 'False) (U1 :: Type -> Type))))

data SubscribedPartitions Source #

Partitions subscribed by a consumer

Constructors

SubscribedPartitions [PartitionId]

Subscribe only to those partitions

SubscribedPartitionsAll

Subscribe to all partitions

Instances

Instances details
Eq SubscribedPartitions Source # 
Instance details

Defined in Kafka.Consumer.Types

Show SubscribedPartitions Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic SubscribedPartitions Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep SubscribedPartitions :: Type -> Type #

type Rep SubscribedPartitions Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep SubscribedPartitions = D1 ('MetaData "SubscribedPartitions" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'False) (C1 ('MetaCons "SubscribedPartitions" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PartitionId])) :+: C1 ('MetaCons "SubscribedPartitionsAll" 'PrefixI 'False) (U1 :: Type -> Type))

data Timestamp Source #

Consumer record timestamp

Instances

Instances details
Eq Timestamp Source # 
Instance details

Defined in Kafka.Consumer.Types

Read Timestamp Source # 
Instance details

Defined in Kafka.Consumer.Types

Show Timestamp Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic Timestamp Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep Timestamp :: Type -> Type #

type Rep Timestamp Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep Timestamp = D1 ('MetaData "Timestamp" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'False) (C1 ('MetaCons "CreateTime" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Millis)) :+: (C1 ('MetaCons "LogAppendTime" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Millis)) :+: C1 ('MetaCons "NoTimestamp" 'PrefixI 'False) (U1 :: Type -> Type)))

data OffsetCommit Source #

Offsets commit mode

Constructors

OffsetCommit

Forces consumer to block until the broker offsets commit is done

OffsetCommitAsync

Offsets will be committed in a non-blocking way

Instances

Instances details
Eq OffsetCommit Source # 
Instance details

Defined in Kafka.Consumer.Types

Show OffsetCommit Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic OffsetCommit Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep OffsetCommit :: Type -> Type #

type Rep OffsetCommit Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep OffsetCommit = D1 ('MetaData "OffsetCommit" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'False) (C1 ('MetaCons "OffsetCommit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OffsetCommitAsync" 'PrefixI 'False) (U1 :: Type -> Type))

data OffsetStoreSync Source #

Indicates how offsets are to be synced to disk

Constructors

OffsetSyncDisable

Do not sync offsets (in Kafka: -1)

OffsetSyncImmediate

Sync immediately after each offset commit (in Kafka: 0)

OffsetSyncInterval Int

Sync after specified interval in millis

Instances

Instances details
Eq OffsetStoreSync Source # 
Instance details

Defined in Kafka.Consumer.Types

Show OffsetStoreSync Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic OffsetStoreSync Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep OffsetStoreSync :: Type -> Type #

type Rep OffsetStoreSync Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep OffsetStoreSync = D1 ('MetaData "OffsetStoreSync" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'False) (C1 ('MetaCons "OffsetSyncDisable" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "OffsetSyncImmediate" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OffsetSyncInterval" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))

data OffsetStoreMethod Source #

Indicates the method of storing the offsets

Constructors

OffsetStoreBroker

Offsets are stored in Kafka broker (preferred)

OffsetStoreFile FilePath OffsetStoreSync

Offsets are stored in a file (and synced to disk according to the sync policy)

Instances

Instances details
Eq OffsetStoreMethod Source # 
Instance details

Defined in Kafka.Consumer.Types

Show OffsetStoreMethod Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic OffsetStoreMethod Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep OffsetStoreMethod :: Type -> Type #

type Rep OffsetStoreMethod Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep OffsetStoreMethod = D1 ('MetaData "OffsetStoreMethod" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'False) (C1 ('MetaCons "OffsetStoreBroker" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OffsetStoreFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OffsetStoreSync)))

data TopicPartition Source #

Kafka topic partition structure

Instances

Instances details
Eq TopicPartition Source # 
Instance details

Defined in Kafka.Consumer.Types

Show TopicPartition Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic TopicPartition Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep TopicPartition :: Type -> Type #

type Rep TopicPartition Source # 
Instance details

Defined in Kafka.Consumer.Types

type Rep TopicPartition = D1 ('MetaData "TopicPartition" "Kafka.Consumer.Types" "hw-kafka-client-5.0.0-inplace" 'False) (C1 ('MetaCons "TopicPartition" 'PrefixI 'True) (S1 ('MetaSel ('Just "tpTopicName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TopicName) :*: (S1 ('MetaSel ('Just "tpPartition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PartitionId) :*: S1 ('MetaSel ('Just "tpOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PartitionOffset))))

data ConsumerRecord k v Source #

Represents a received message from Kafka (i.e. used in a consumer)

Constructors

ConsumerRecord 

Fields

Instances

Instances details
Bitraversable ConsumerRecord Source # 
Instance details

Defined in Kafka.Consumer.Types

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> ConsumerRecord a b -> f (ConsumerRecord c d) #

Bifoldable ConsumerRecord Source # 
Instance details

Defined in Kafka.Consumer.Types

Methods

bifold :: Monoid m => ConsumerRecord m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> ConsumerRecord a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> ConsumerRecord a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> ConsumerRecord a b -> c #

Bifunctor ConsumerRecord Source # 
Instance details

Defined in Kafka.Consumer.Types

Methods

bimap :: (a -> b) -> (c -> d) -> ConsumerRecord a c -> ConsumerRecord b d #

first :: (a -> b) -> ConsumerRecord a c -> ConsumerRecord b c #

second :: (b -> c) -> ConsumerRecord a b -> ConsumerRecord a c #

Functor (ConsumerRecord k) Source # 
Instance details

Defined in Kafka.Consumer.Types

Methods

fmap :: (a -> b) -> ConsumerRecord k a -> ConsumerRecord k b #

(<$) :: a -> ConsumerRecord k b -> ConsumerRecord k a #

Foldable (ConsumerRecord k) Source # 
Instance details

Defined in Kafka.Consumer.Types

Methods

fold :: Monoid m => ConsumerRecord k m -> m #

foldMap :: Monoid m => (a -> m) -> ConsumerRecord k a -> m #

foldMap' :: Monoid m => (a -> m) -> ConsumerRecord k a -> m #

foldr :: (a -> b -> b) -> b -> ConsumerRecord k a -> b #

foldr' :: (a -> b -> b) -> b -> ConsumerRecord k a -> b #

foldl :: (b -> a -> b) -> b -> ConsumerRecord k a -> b #

foldl' :: (b -> a -> b) -> b -> ConsumerRecord k a -> b #

foldr1 :: (a -> a -> a) -> ConsumerRecord k a -> a #

foldl1 :: (a -> a -> a) -> ConsumerRecord k a -> a #

toList :: ConsumerRecord k a -> [a] #

null :: ConsumerRecord k a -> Bool #

length :: ConsumerRecord k a -> Int #

elem :: Eq a => a -> ConsumerRecord k a -> Bool #

maximum :: Ord a => ConsumerRecord k a -> a #

minimum :: Ord a => ConsumerRecord k a -> a #

sum :: Num a => ConsumerRecord k a -> a #

product :: Num a => ConsumerRecord k a -> a #

Traversable (ConsumerRecord k) Source # 
Instance details

Defined in Kafka.Consumer.Types

Methods

traverse :: Applicative f => (a -> f b) -> ConsumerRecord k a -> f (ConsumerRecord k b) #

sequenceA :: Applicative f => ConsumerRecord k (f a) -> f (ConsumerRecord k a) #

mapM :: Monad m => (a -> m b) -> ConsumerRecord k a -> m (ConsumerRecord k b) #

sequence :: Monad m => ConsumerRecord k (m a) -> m (ConsumerRecord k a) #

(Eq k, Eq v) => Eq (ConsumerRecord k v) Source # 
Instance details

Defined in Kafka.Consumer.Types

(Read k, Read v) => Read (ConsumerRecord k v) Source # 
Instance details

Defined in Kafka.Consumer.Types

(Show k, Show v) => Show (ConsumerRecord k v) Source # 
Instance details

Defined in Kafka.Consumer.Types

Generic (ConsumerRecord k v) Source # 
Instance details

Defined in Kafka.Consumer.Types

Associated Types

type Rep (ConsumerRecord k v) :: Type -> Type #

Methods

from :: ConsumerRecord k v -> Rep (ConsumerRecord k v) x #

to :: Rep (ConsumerRecord k v) x -> ConsumerRecord k v #

type Rep (ConsumerRecord k v) Source # 
Instance details

Defined in Kafka.Consumer.Types

crMapKey :: (k -> k') -> ConsumerRecord k v -> ConsumerRecord k' v Source #

Deprecated: Isn't concern of this library. Use first

crMapValue :: (v -> v') -> ConsumerRecord k v -> ConsumerRecord k v' Source #

Deprecated: Isn't concern of this library. Use second

crMapKV :: (k -> k') -> (v -> v') -> ConsumerRecord k v -> ConsumerRecord k' v' Source #

Deprecated: Isn't concern of this library. Use bimap

Deprecated

sequenceFirst :: (Bitraversable t, Applicative f) => t (f k) v -> f (t k v) Source #

Deprecated: Isn't concern of this library. Use bitraverse id pure

traverseFirst :: (Bitraversable t, Applicative f) => (k -> f k') -> t k v -> f (t k' v) Source #

Deprecated: Isn't concern of this library. Use bitraverse f pure

traverseFirstM :: (Bitraversable t, Applicative f, Monad m) => (k -> m (f k')) -> t k v -> m (f (t k' v)) Source #

Deprecated: Isn't concern of this library. Use bitraverse id pure <$> bitraverse f pure r

traverseM :: (Traversable t, Applicative f, Monad m) => (v -> m (f v')) -> t v -> m (f (t v')) Source #

Deprecated: Isn't concern of this library. Use sequenceA <$> traverse f r

bitraverseM :: (Bitraversable t, Applicative f, Monad m) => (k -> m (f k')) -> (v -> m (f v')) -> t k v -> m (f (t k' v')) Source #

Deprecated: Isn't concern of this library. Use bisequenceA <$> bimapM f g r