EventProcessorOptions Class
- java.
lang. Object - com.
microsoft. azure. eventprocessorhost. EventProcessorOptions
- com.
public class EventProcessorOptions
Constructor Summary
Constructor | Description | |
---|---|---|
EventProcessorOptions() |
Method Summary
Modifier and Type | Method and Description |
---|---|
Event |
getDefaultOptions() |
Function<String, Event |
getInitialPositionProvider() |
Boolean | getInvokeProcessorAfterReceiveTimeout() |
int |
getMaxBatchSize()
Returns the maximum number of events that will be passed to one call to IEventProcessor.onEvents |
int | getPrefetchCount() |
boolean |
getReceiverRuntimeMetricEnabled()
Knob to enable/disable runtime metric of the receiver. If this is set to true, the first parameter com.microsoft.azure.eventprocessorhost.PartitionContext#runtimeInformation of IEventProcessor#onEvents(com.microsoft.azure.eventprocessorhost.PartitionContext, java.lang.Iterable) will be populated. Enabling this knob will add 3 additional properties to all raw AMQP events received. |
Duration |
getReceiveTimeOut()
Returns the timeout for receive operations. |
void |
setExceptionNotification(Consumer<ExceptionReceivedEventArgs> notificationHandler)
Sets a handler which receives notification of general exceptions. Exceptions which occur while processing events from a particular Event Hub partition are delivered to the onError method of the event processor for that partition. This handler is called on occasions when there is no event processor associated with the throwing activity, or the event processor could not be created. The handler is not expected to do anything about the exception. If it is possible to recover, the event processor host instance will recover automatically. |
void | setInitialPositionProvider(Function<String, EventPosition> initialPositionProvider) |
void |
setInvokeProcessorAfterReceiveTimeout(Boolean invokeProcessorAfterReceiveTimeout)
Changes whether the EventProcessorHost will call IEventProcessor.onEvents() with an empty iterable when a receive timeout occurs (true) or not (false). The default is false (no call). |
void |
setMaxBatchSize(int maxBatchSize)
Sets the maximum number of events that will be passed to one call to IEventProcessor.onEvents |
void | setPrefetchCount(int prefetchCount) |
void |
setReceiverRuntimeMetricEnabled(boolean value)
Knob to enable/disable runtime metric of the receiver. If this is set to true, the first parameter com.microsoft.azure.eventprocessorhost.PartitionContext#runtimeInformation of IEventProcessor#onEvents(com.microsoft.azure.eventprocessorhost.PartitionContext, java.lang.Iterable) will be populated. Enabling this knob will add 3 additional properties to all raw AMQP events received. |
void |
setReceiveTimeOut(Duration receiveTimeOut)
Sets the timeout for receive operations. |
Constructor Details
EventProcessorOptions
public EventProcessorOptions()
Method Details
getDefaultOptions
public static EventProcessorOptions getDefaultOptions()
getInitialPositionProvider
public Function
getInvokeProcessorAfterReceiveTimeout
public Boolean getInvokeProcessorAfterReceiveTimeout()
getMaxBatchSize
public int getMaxBatchSize()
Returns the maximum number of events that will be passed to one call to IEventProcessor.onEvents
Returns:
getPrefetchCount
public int getPrefetchCount()
getReceiverRuntimeMetricEnabled
public boolean getReceiverRuntimeMetricEnabled()
Knob to enable/disable runtime metric of the receiver. If this is set to true, the first parameter com.microsoft.azure.eventprocessorhost.PartitionContext#runtimeInformation of IEventProcessor#onEvents(com.microsoft.azure.eventprocessorhost.PartitionContext, java.lang.Iterable) will be populated.
Enabling this knob will add 3 additional properties to all raw AMQP events received.
Returns:
getReceiveTimeOut
public Duration getReceiveTimeOut()
Returns the timeout for receive operations.
Returns:
setExceptionNotification
public void setExceptionNotification(Consumer
Sets a handler which receives notification of general exceptions.
Exceptions which occur while processing events from a particular Event Hub partition are delivered to the onError method of the event processor for that partition. This handler is called on occasions when there is no event processor associated with the throwing activity, or the event processor could not be created.
The handler is not expected to do anything about the exception. If it is possible to recover, the event processor host instance will recover automatically.
Parameters:
setInitialPositionProvider
public void setInitialPositionProvider(Function
Parameters:
setInvokeProcessorAfterReceiveTimeout
public void setInvokeProcessorAfterReceiveTimeout(Boolean invokeProcessorAfterReceiveTimeout)
Changes whether the EventProcessorHost will call IEventProcessor.onEvents() with an empty iterable when a receive timeout occurs (true) or not (false).
The default is false (no call).
Parameters:
setMaxBatchSize
public void setMaxBatchSize(int maxBatchSize)
Sets the maximum number of events that will be passed to one call to IEventProcessor.onEvents
Parameters:
setPrefetchCount
public void setPrefetchCount(int prefetchCount)
Parameters:
setReceiverRuntimeMetricEnabled
public void setReceiverRuntimeMetricEnabled(boolean value)
Knob to enable/disable runtime metric of the receiver. If this is set to true, the first parameter com.microsoft.azure.eventprocessorhost.PartitionContext#runtimeInformation of IEventProcessor#onEvents(com.microsoft.azure.eventprocessorhost.PartitionContext, java.lang.Iterable) will be populated.
Enabling this knob will add 3 additional properties to all raw AMQP events received.
Parameters:
setReceiveTimeOut
public void setReceiveTimeOut(Duration receiveTimeOut)
Sets the timeout for receive operations.
Parameters:
Applies to
Azure SDK for Java