com.microsoft.azure.eventhubs.PartitionReceiveHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-eventhubs Show documentation
Show all versions of azure-eventhubs Show documentation
Client library for talking to Microsoft Azure Event Hubs.
/*
* Copyright (c) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
package com.microsoft.azure.eventhubs;
/**
* The handler to invoke after receiving {@link EventData}s from Microsoft Azure EventHubs. Use any implementation of this abstract class to specify
* user action when using PartitionReceiver's setReceiveHandler().
*
* @see PartitionReceiver#setReceiveHandler
*/
public interface PartitionReceiveHandler {
/**
* Maximum number of {@link EventData} to supply while invoking {@link #onReceive(Iterable)}
*
* @return value indicating the maximum number of {@link EventData} to supply while invoking {@link #onReceive(Iterable)}
*/
int getMaxEventCount();
/**
* user should implement this method to specify the action to be performed on the received events.
*
* @param events the list of fetched events from the corresponding PartitionReceiver.
* @see PartitionReceiver#receive
*/
void onReceive(final Iterable events);
/**
* Implement this method to Listen to errors which lead to Closure of the {@link PartitionReceiveHandler} pump.
*
* @param error fatal error encountered while running the {@link PartitionReceiveHandler} pump
*/
void onError(final Throwable error);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy