-
Couldn't load subscription status.
- Fork 74
Closed
Description
Add a default initializeListener(QueryBatcher) method to QueryBatchListener which does nothing. Custom listeners that wants to retry in case of failover exceptions, have to override this method and initialize the RetryListener that facilitates retrying the listeners. The implementation of the method which would help retrying the listener is as follows:
@Override
public void initializeListener(QueryBatcher queryBatcher) {
HostAvailabilityListener hostAvailabilityListener = HostAvailabilityListener.getInstance(queryBatcher);
if ( hostAvailabilityListener != null ) {
BatchFailureListener<QueryBatch> retryListener = hostAvailabilityListener.initializeRetryListener(this);
if( retryListener != null ) onFailure(retryListener);
}
}
and you have to call this method in the processEvent(QueryBatch) method like
initializeListener(batch.getBatcher());