Interface SubscriptionListener
public interface SubscriptionListener
Callback interface to customize a subscription.
It is possible to change the computed OffsetSpecification in preSubscribe(SubscriptionContext) by using a custom offset tracking strategy.
This is an experimental API, subject to change.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceContext object for the subscription. -
Method Summary
Modifier and TypeMethodDescriptionvoidpreSubscribe(SubscriptionListener.SubscriptionContext subscriptionContext) Callback called before the subscription is created.
-
Method Details
-
preSubscribe
Callback called before the subscription is created.The method is called when a
Consumeris created and it registers to the broker, and also when the subscription must be re-created (after a disconnection or when the subscription must move because the stream member it was connected to becomes unavailable).Application code can set the
OffsetSpecificationthat will be used with theSubscriptionListener.SubscriptionContext.offsetSpecification(OffsetSpecification)method.- Parameters:
subscriptionContext-
-