Skip to content

Support error handling in RebalanceCallback #128

@nikitapecasa

Description

@nikitapecasa

This is a follow-up task to #122.

Currently errors from consumer related methods are thrown in a poll thread,
and there's no way to provide recovering code inside [[RebalanceCallback]].

For example:

def onPartitionsAssigned(partitions: Nes[TopicPartition]) = {
  for {
    state <- lift(restoreStateFor(partitions))
    _       <- state.offsets.traverse_(o => seek(o.partition, o.offset))
  } yield ()
}

if seek operation fails, exception is thrown in a poll thread, and user cannot provide recovering code while building a RebalanceCallback.

To fix it we need to implement MonadThrowable instance for RebalanceCallback

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions