Sdílet prostřednictvím


PartitionReceiveHandler Interface

public interface PartitionReceiveHandler

The handler to invoke after receiving EventDatas from Microsoft Azure EventHubs. Use any implementation of this abstract class to specify user action when using PartitionReceiver's setReceiveHandler().

Method Summary

Modifier and Type Method and Description
abstract int getMaxEventCount()

Maximum number of EventData to supply while invoking onReceive(Iterable<EventData> events)

abstract void onError(Throwable error)

Implement this method to Listen to errors which lead to Closure of the PartitionReceiveHandler pump.

abstract void onReceive(Iterable<EventData> events)

user should implement this method to specify the action to be performed on the received events.

Method Details

getMaxEventCount

public abstract int getMaxEventCount()

Maximum number of EventData to supply while invoking onReceive(Iterable<EventData> events)

Ensure that the value should be less than or equal to the value of getPrefetchCount()

Returns:

value indicating the maximum number of EventData to supply while invoking onReceive(Iterable<EventData> events)

onError

public abstract void onError(Throwable error)

Implement this method to Listen to errors which lead to Closure of the PartitionReceiveHandler pump.

Parameters:

error - fatal error encountered while running the PartitionReceiveHandler pump

onReceive

public abstract void onReceive(Iterable 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.

Applies to