Safe Haskell | None |
---|---|
Language | Haskell2010 |
Kafka.Types
Description
Module holding types shared by consumer and producer modules.
Synopsis
- newtype BrokerId = BrokerId {
- unBrokerId :: Int
- newtype PartitionId = PartitionId {
- unPartitionId :: Int
- newtype Millis = Millis {}
- newtype ClientId = ClientId {
- unClientId :: Text
- newtype BatchSize = BatchSize {
- unBatchSize :: Int
- newtype TopicName = TopicName {
- unTopicName :: Text
- newtype BrokerAddress = BrokerAddress {}
- newtype Timeout = Timeout {}
- data KafkaLogLevel
- data KafkaError
- data KafkaDebug
- data KafkaCompressionCodec
- = NoCompression
- | Gzip
- | Snappy
- | Lz4
- | Zstd
- data TopicType
- data Headers
- headersFromList :: [(ByteString, ByteString)] -> Headers
- headersToList :: Headers -> [(ByteString, ByteString)]
- topicType :: TopicName -> TopicType
- kafkaDebugToText :: KafkaDebug -> Text
- kafkaCompressionCodecToText :: KafkaCompressionCodec -> Text
Documentation
Kafka broker ID
Constructors
BrokerId | |
Fields
|
newtype PartitionId Source #
Topic partition ID
Constructors
PartitionId | |
Fields
|
Instances
A number of milliseconds, used to represent durations and timestamps
Client ID used by Kafka to better track requests
Constructors
ClientId | |
Fields
|
Instances
IsString ClientId Source # | |||||
Defined in Kafka.Types Methods fromString :: String -> ClientId # | |||||
Generic ClientId Source # | |||||
Defined in Kafka.Types Associated Types
| |||||
Show ClientId Source # | |||||
Eq ClientId Source # | |||||
Ord ClientId Source # | |||||
Defined in Kafka.Types | |||||
type Rep ClientId Source # | |||||
Defined in Kafka.Types |
Batch size used for polling
Constructors
BatchSize | |
Fields
|
Instances
Generic BatchSize Source # | |||||
Defined in Kafka.Types Associated Types
| |||||
Num BatchSize Source # | |||||
Read BatchSize Source # | |||||
Show BatchSize Source # | |||||
Eq BatchSize Source # | |||||
Ord BatchSize Source # | |||||
type Rep BatchSize Source # | |||||
Defined in Kafka.Types |
Topic name to consume/produce messages
Wildcard (regex) topics are supported by the librdkafka assignor:
any topic name in the topics list that is prefixed with ^
will
be regex-matched to the full list of topics in the cluster and matching
topics will be added to the subscription list.
Constructors
TopicName | |
Fields
|
Instances
IsString TopicName Source # | |||||
Defined in Kafka.Types Methods fromString :: String -> TopicName # | |||||
Generic TopicName Source # | |||||
Defined in Kafka.Types Associated Types
| |||||
Read TopicName Source # | |||||
Show TopicName Source # | |||||
Eq TopicName Source # | |||||
Ord TopicName Source # | |||||
type Rep TopicName Source # | |||||
Defined in Kafka.Types |
newtype BrokerAddress Source #
Kafka broker address string (e.g. broker1:9092
)
Constructors
BrokerAddress | |
Fields |
Instances
IsString BrokerAddress Source # | |||||
Defined in Kafka.Types Methods fromString :: String -> BrokerAddress # | |||||
Generic BrokerAddress Source # | |||||
Defined in Kafka.Types Associated Types
| |||||
Show BrokerAddress Source # | |||||
Defined in Kafka.Types Methods showsPrec :: Int -> BrokerAddress -> ShowS # show :: BrokerAddress -> String # showList :: [BrokerAddress] -> ShowS # | |||||
Eq BrokerAddress Source # | |||||
Defined in Kafka.Types Methods (==) :: BrokerAddress -> BrokerAddress -> Bool # (/=) :: BrokerAddress -> BrokerAddress -> Bool # | |||||
type Rep BrokerAddress Source # | |||||
Defined in Kafka.Types type Rep BrokerAddress = D1 ('MetaData "BrokerAddress" "Kafka.Types" "hw-kafka-client-5.3.0-8OZSN6XHxJUEBGq88IRkoi" 'True) (C1 ('MetaCons "BrokerAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBrokerAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
Timeout in milliseconds
data KafkaLogLevel Source #
Log levels for librdkafka.
Constructors
KafkaLogEmerg | |
KafkaLogAlert | |
KafkaLogCrit | |
KafkaLogErr | |
KafkaLogWarning | |
KafkaLogNotice | |
KafkaLogInfo | |
KafkaLogDebug |
Instances
Enum KafkaLogLevel Source # | |
Defined in Kafka.Types Methods succ :: KafkaLogLevel -> KafkaLogLevel # pred :: KafkaLogLevel -> KafkaLogLevel # toEnum :: Int -> KafkaLogLevel # fromEnum :: KafkaLogLevel -> Int # enumFrom :: KafkaLogLevel -> [KafkaLogLevel] # enumFromThen :: KafkaLogLevel -> KafkaLogLevel -> [KafkaLogLevel] # enumFromTo :: KafkaLogLevel -> KafkaLogLevel -> [KafkaLogLevel] # enumFromThenTo :: KafkaLogLevel -> KafkaLogLevel -> KafkaLogLevel -> [KafkaLogLevel] # | |
Show KafkaLogLevel Source # | |
Defined in Kafka.Types Methods showsPrec :: Int -> KafkaLogLevel -> ShowS # show :: KafkaLogLevel -> String # showList :: [KafkaLogLevel] -> ShowS # | |
Eq KafkaLogLevel Source # | |
Defined in Kafka.Types Methods (==) :: KafkaLogLevel -> KafkaLogLevel -> Bool # (/=) :: KafkaLogLevel -> KafkaLogLevel -> Bool # |
data KafkaError Source #
All possible Kafka errors
Constructors
KafkaError Text | |
KafkaInvalidReturnValue | |
KafkaBadSpecification Text | |
KafkaResponseError RdKafkaRespErrT | |
KafkaInvalidConfigurationValue Text | |
KafkaUnknownConfigurationKey Text | |
KafkaBadConfiguration |
Instances
Exception KafkaError Source # | |||||
Defined in Kafka.Types Methods toException :: KafkaError -> SomeException # fromException :: SomeException -> Maybe KafkaError # displayException :: KafkaError -> String # backtraceDesired :: KafkaError -> Bool # | |||||
Generic KafkaError Source # | |||||
Defined in Kafka.Types Associated Types
| |||||
Show KafkaError Source # | |||||
Defined in Kafka.Types Methods showsPrec :: Int -> KafkaError -> ShowS # show :: KafkaError -> String # showList :: [KafkaError] -> ShowS # | |||||
Eq KafkaError Source # | |||||
Defined in Kafka.Types | |||||
type Rep KafkaError Source # | |||||
Defined in Kafka.Types type Rep KafkaError = D1 ('MetaData "KafkaError" "Kafka.Types" "hw-kafka-client-5.3.0-8OZSN6XHxJUEBGq88IRkoi" 'False) ((C1 ('MetaCons "KafkaError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "KafkaInvalidReturnValue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KafkaBadSpecification" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) :+: ((C1 ('MetaCons "KafkaResponseError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RdKafkaRespErrT)) :+: C1 ('MetaCons "KafkaInvalidConfigurationValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "KafkaUnknownConfigurationKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "KafkaBadConfiguration" 'PrefixI 'False) (U1 :: Type -> Type)))) |
data KafkaDebug Source #
Available librdkafka debug contexts
Constructors
DebugGeneric | |
DebugBroker | |
DebugTopic | |
DebugMetadata | |
DebugQueue | |
DebugMsg | |
DebugProtocol | |
DebugCgrp | |
DebugSecurity | |
DebugFetch | |
DebugFeature | |
DebugAll |
Instances
Generic KafkaDebug Source # | |||||
Defined in Kafka.Types Associated Types
| |||||
Show KafkaDebug Source # | |||||
Defined in Kafka.Types Methods showsPrec :: Int -> KafkaDebug -> ShowS # show :: KafkaDebug -> String # showList :: [KafkaDebug] -> ShowS # | |||||
Eq KafkaDebug Source # | |||||
Defined in Kafka.Types | |||||
type Rep KafkaDebug Source # | |||||
Defined in Kafka.Types type Rep KafkaDebug = D1 ('MetaData "KafkaDebug" "Kafka.Types" "hw-kafka-client-5.3.0-8OZSN6XHxJUEBGq88IRkoi" 'False) (((C1 ('MetaCons "DebugGeneric" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DebugBroker" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DebugTopic" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "DebugMetadata" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DebugQueue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DebugMsg" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "DebugProtocol" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DebugCgrp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DebugSecurity" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "DebugFetch" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DebugFeature" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DebugAll" 'PrefixI 'False) (U1 :: Type -> Type))))) |
data KafkaCompressionCodec Source #
Compression codec used by a topic
Constructors
NoCompression | |
Gzip | |
Snappy | |
Lz4 | |
Zstd |
Instances
Generic KafkaCompressionCodec Source # | |||||
Defined in Kafka.Types Associated Types
Methods from :: KafkaCompressionCodec -> Rep KafkaCompressionCodec x # to :: Rep KafkaCompressionCodec x -> KafkaCompressionCodec # | |||||
Show KafkaCompressionCodec Source # | |||||
Defined in Kafka.Types Methods showsPrec :: Int -> KafkaCompressionCodec -> ShowS # show :: KafkaCompressionCodec -> String # showList :: [KafkaCompressionCodec] -> ShowS # | |||||
Eq KafkaCompressionCodec Source # | |||||
Defined in Kafka.Types Methods (==) :: KafkaCompressionCodec -> KafkaCompressionCodec -> Bool # (/=) :: KafkaCompressionCodec -> KafkaCompressionCodec -> Bool # | |||||
type Rep KafkaCompressionCodec Source # | |||||
Defined in Kafka.Types type Rep KafkaCompressionCodec = D1 ('MetaData "KafkaCompressionCodec" "Kafka.Types" "hw-kafka-client-5.3.0-8OZSN6XHxJUEBGq88IRkoi" 'False) ((C1 ('MetaCons "NoCompression" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gzip" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Snappy" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Lz4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Zstd" 'PrefixI 'False) (U1 :: Type -> Type)))) |
Whether the topic is created by a user or by the system
Constructors
User | Normal topics that are created by user. |
System | Topics starting with a double underscore "__" ( |
Instances
Generic TopicType Source # | |
Defined in Kafka.Types | |
Read TopicType Source # | |
Show TopicType Source # | |
Eq TopicType Source # | |
Ord TopicType Source # | |
type Rep TopicType Source # | |
Headers that might be passed along with a record
Instances
Monoid Headers Source # | |||||
Semigroup Headers Source # | |||||
Generic Headers Source # | |||||
Defined in Kafka.Types Associated Types
| |||||
Read Headers Source # | |||||
Show Headers Source # | |||||
Eq Headers Source # | |||||
type Rep Headers Source # | |||||
Defined in Kafka.Types type Rep Headers = D1 ('MetaData "Headers" "Kafka.Types" "hw-kafka-client-5.3.0-8OZSN6XHxJUEBGq88IRkoi" 'True) (C1 ('MetaCons "Headers" 'PrefixI 'True) (S1 ('MetaSel ('Just "unHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(ByteString, ByteString)]))) |
headersFromList :: [(ByteString, ByteString)] -> Headers Source #
headersToList :: Headers -> [(ByteString, ByteString)] Source #
topicType :: TopicName -> TopicType Source #
Deduce the type of a topic from its name, by checking if it starts with a double underscore "__"
kafkaDebugToText :: KafkaDebug -> Text Source #
Convert a KafkaDebug
into its librdkafka string equivalent.
This is used internally by the library but may be useful to some developers.
kafkaCompressionCodecToText :: KafkaCompressionCodec -> Text Source #
Convert a KafkaCompressionCodec
into its librdkafka string equivalent.
This is used internally by the library but may be useful to some developers.