Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a synchronous interface on top of the hw-kafka-client
It works by using MVars managed in two different queues. Each request is sent as soon as there are no other effectively equal Kafka records in-flight. This is done in order to make sure that there is no ambiguity as to which MVar to resolve.
Currently, this implements fair sending. For all requests, the oldest pending request should be sent first.
Synopsis
- data SyncKafkaProducer
- newSyncProducer :: MonadIO m => ProducerProperties -> m (Either KafkaError SyncKafkaProducer)
- produceRecord :: MonadIO m => SyncKafkaProducer -> ProducerRecord -> m (Either KafkaError ())
- data KafkaError
- data ProducerRecord = ProducerRecord {}
- data ProducePartition
- newtype TopicName = TopicName {
- unTopicName :: Text
Sync producer
data SyncKafkaProducer Source #
A producer for sending messages to Kafka and waiting for the DeliveryReport
newSyncProducer :: MonadIO m => ProducerProperties -> m (Either KafkaError SyncKafkaProducer) Source #
Create a new SyncKafkaProducer
Note: since this library wraps the regular hw-kafka-client, please be aware that you should not set the delivery report callback. As it is set internally.
produceRecord :: MonadIO m => SyncKafkaProducer -> ProducerRecord -> m (Either KafkaError ()) Source #
Re-exports
data KafkaError #
KafkaError Text | |
KafkaInvalidReturnValue | |
KafkaBadSpecification Text | |
KafkaResponseError RdKafkaRespErrT | |
KafkaInvalidConfigurationValue Text | |
KafkaUnknownConfigurationKey Text | |
KafkaBadConfiguration |
Instances
data ProducerRecord #
ProducerRecord | |
|
Instances
data ProducePartition #