-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
The C function for consuming always returns an rd_kafka_message_t, which contains an rd_kafka_resp_err_t in the case of failure. Unfortunately this error value is not self-contained, making sense of it may require inspecting other fields of the rd_kafka_message_t. For example, if you get a partition EOF, you'll have to inspect the partition field to determine which partition the EOF applies to.
In contrast, the Haskell function for consuming is
pollMessage :: MonadIO m
=> KafkaConsumer
-> Timeout -- ^ the timeout, in milliseconds
-> m (Either KafkaError (ConsumerRecord (Maybe BS.ByteString) (Maybe BS.ByteString))) -- ^ Left on error or timeout, right for successThis is a much more natural type since the error case is disjoint, but the KafkaError type is missing some crucial context. E.g. there appears to be no way for me to determine which partition hit the EOF. This is important if you want to consume the entire topic in one go and then stop.
Metadata
Metadata
Assignees
Labels
No labels