hw-kafka-client-3.1.1: Kafka bindings for Haskell

Safe HaskellNone
LanguageHaskell2010

Kafka.Producer.ProducerProperties

Synopsis

Documentation

setCallback :: (KafkaConf -> IO ()) -> ProducerProperties Source #

logLevel :: KafkaLogLevel -> ProducerProperties Source #

Sets the logging level. Usually is used with debugOptions to configure which logs are needed.

extraProps :: Map Text Text -> ProducerProperties Source #

Any configuration options that are supported by librdkafka. The full list can be found here

suppressDisconnectLogs :: ProducerProperties Source #

Suppresses producer disconnects logs.

It might be useful to turn this off when interacting with brokers with an aggressive connection.max.idle.ms value.

extraTopicProps :: Map Text Text -> ProducerProperties Source #

Any configuration options that are supported by librdkafka. The full list can be found here

debugOptions :: [KafkaDebug] -> ProducerProperties Source #

Sets debug features for the producer Usually is used with logLevel.

deliveryCallback :: (DeliveryReport -> IO ()) -> KafkaConf -> IO () Source #

Sets the callback for delivery reports.

/Note: A callback should not be a long-running process as it blocks librdkafka from continuing on the thread that handles the delivery callbacks. For callbacks to individual messsages see 'Kafka.Producer.produceMessage\''./

errorCallback :: HasKafkaConf k => (KafkaError -> String -> IO ()) -> k -> IO () Source #

Add a callback for errors.

Examples

Expand

Basic usage:

setCallback (errorCallback myErrorCallback)

myErrorCallback :: KafkaError -> String -> IO ()
myErrorCallback kafkaError message = print $ show kafkaError <> "|" <> message

logCallback :: HasKafkaConf k => (KafkaLogLevel -> String -> String -> IO ()) -> k -> IO () Source #

Add a callback for logs.

Examples

Expand

Basic usage:

setCallback (logCallback myLogCallback)

myLogCallback :: KafkaLogLevel -> String -> String -> IO ()
myLogCallback level facility message = print $ show level <> "|" <> facility <> "|" <> message

statsCallback :: HasKafkaConf k => (String -> IO ()) -> k -> IO () Source #

Add a callback for stats.

Examples

Expand

Basic usage:

setCallback (statsCallback myStatsCallback)

myStatsCallback :: String -> IO ()
myStatsCallback stats = print $ show stats