Class EventBatcher
- java.lang.Object
-
- org.zalando.nakadiproducer.transmission.impl.EventBatcher
-
public class EventBatcher extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classEventBatcher.BatchItem
-
Constructor Summary
Constructors Constructor Description EventBatcher(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Consumer<List<EventBatcher.BatchItem>> publisher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinish()Publishes all events which were pushed and not yet published.voidpushEvent(EventLog eventLogEntry, NakadiEvent nakadiEvent)Pushes one event to be published.
-
-
-
Constructor Detail
-
EventBatcher
public EventBatcher(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Consumer<List<EventBatcher.BatchItem>> publisher)
-
-
Method Detail
-
pushEvent
public void pushEvent(EventLog eventLogEntry, NakadiEvent nakadiEvent)
Pushes one event to be published. It will be either published right now, or with some other events, latest when callingfinish().- Parameters:
eventLogEntry- The event log entry for this event.nakadiEvent- The Nakadi form of the event.
-
finish
public void finish()
Publishes all events which were pushed and not yet published.
-
-