Interface ConsumerUpdateListener


public interface ConsumerUpdateListener
An interface for reacting to status changes of single active consumers.

An application uses the update(Context) callback to compute the offset to start consuming from when the consumer becomes active.

The application can also use the update(Context) callback to store the offset of the last message it processed when the consumer goes from active to passive.

This is especially useful when using manual server-side offset tracking or offset tracking from an external datastore.

See Also:
  • Method Details

    • update

      Callback when the consumer status change.

      The method must return the offset specification to resume consumption from when the consumer becomes active. The broker will use the value to initialize the dispatching of messages from the appropriate location.

      The broker ignores the returned value when the consumer becomes inactive.

      Parameters:
      context - information on the status change
      Returns:
      the offset specification to consume from if the status is active