Package org.zalando.fahrschein
Interface EventPublishingHandler
public interface EventPublishingHandler
Interface that offers a way to add additional features around the
NakadiClient.
As the methods of this class are invoked on every publish request, we shouldn't
- do heavy computations as it might affect performance significantly
- do modification of requests-
Method Summary
Modifier and TypeMethodDescriptionvoidThis method is invoked after the publishing of events has happened, regardless if an error occurred during publishing or not.<T> voidInvoked when publishing of events failed, before afterPublish.<T> voidThis method is called by theNakadiClientwhen a request towards Nakadi is going to be sent.
-
Method Details
-
onPublish
This method is called by theNakadiClientwhen a request towards Nakadi is going to be sent. For example, it can be used to record things before that. EveryEventPublishingHandlerimplementation is responsible for catching and logging exceptions happening in this method.- Type Parameters:
T- type of events that we publish- Parameters:
eventName- that is used for the published eventsevents- that are published
-
afterPublish
void afterPublish()This method is invoked after the publishing of events has happened, regardless if an error occurred during publishing or not. EveryEventPublishingHandlerimplementation is responsible for catching and logging exceptions happening in this method. -
onError
Invoked when publishing of events failed, before afterPublish. EveryEventPublishingHandlerimplementation is responsible for catching and logging exceptions happening in this method.- Type Parameters:
T- type of events that we publish- Parameters:
events- original list of events that we tried to publisht- the throwable we experienced while publishing
-