Package com.rabbitmq.stream
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ConsumerUpdateListener.Context
Information on the status change.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OffsetSpecification
update(ConsumerUpdateListener.Context context)
Callback when the consumer status change.
-
-
-
Method Detail
-
update
OffsetSpecification update(ConsumerUpdateListener.Context context)
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
-
-