Package com.microsoft.azure.eventhubs
Interface PartitionReceiveHandler
-
public interface PartitionReceiveHandler
The handler to invoke after receivingEventData
s from Microsoft Azure EventHubs. Use any implementation of this abstract class to specify user action when using PartitionReceiver's setReceiveHandler().
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getMaxEventCount()
Maximum number ofEventData
to supply while invokingonReceive(Iterable)
void
onError(Throwable error)
Implement this method to Listen to errors which lead to Closure of thePartitionReceiveHandler
pump.void
onReceive(Iterable<EventData> events)
user should implement this method to specify the action to be performed on the received events.
-
-
-
Method Detail
-
getMaxEventCount
int getMaxEventCount()
Maximum number ofEventData
to supply while invokingonReceive(Iterable)
Ensure that the value should be less than or equal to the value of
ReceiverOptions.getPrefetchCount()
- Returns:
- value indicating the maximum number of
EventData
to supply while invokingonReceive(Iterable)
-
onReceive
void onReceive(Iterable<EventData> events)
user should implement this method to specify the action to be performed on the received events.- Parameters:
events
- the list of fetched events from the corresponding PartitionReceiver.- See Also:
PartitionReceiver.receive(int)
-
onError
void onError(Throwable error)
Implement this method to Listen to errors which lead to Closure of thePartitionReceiveHandler
pump.- Parameters:
error
- fatal error encountered while running thePartitionReceiveHandler
pump
-
-