Class GetAzureEventHub
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.azure.eventhub.GetAzureEventHub
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor,AzureEventHubComponent
@Tags({"azure","microsoft","cloud","eventhub","events","streaming","streams"})
@CapabilityDescription("Receives messages from Microsoft Azure Event Hubs without reliable checkpoint tracking. In clustered environment, GetAzureEventHub processor instances work independently and all cluster nodes process all messages (unless running the processor in Primary Only mode). ConsumeAzureEventHub offers the recommended approach to receiving messages from Azure Event Hubs. This processor creates a thread pool for connections to Azure Event Hubs.")
@InputRequirement(INPUT_FORBIDDEN)
@WritesAttribute(attribute="eventhub.enqueued.timestamp",description="The time (in milliseconds since epoch, UTC) at which the message was enqueued in the event hub") @WritesAttribute(attribute="eventhub.offset",description="The offset into the partition at which the message was stored") @WritesAttribute(attribute="eventhub.sequence",description="The Azure sequence number associated with the message") @WritesAttribute(attribute="eventhub.name",description="The name of the event hub from which the message was pulled") @WritesAttribute(attribute="eventhub.partition",description="The name of the event hub partition from which the message was pulled") @WritesAttribute(attribute="eventhub.property.*",description="The application properties of this message. IE: \'application\' would be \'eventhub.property.application\'")
@SeeAlso(ConsumeAzureEventHub.class)
public class GetAzureEventHub
extends org.apache.nifi.processor.AbstractProcessor
implements AzureEventHubComponent
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final org.apache.nifi.components.PropertyDescriptorprivate com.azure.messaging.eventhubs.EventHubClientBuilderprivate final AtomicReference<org.apache.nifi.scheduling.ExecutionNode> (package private) static final org.apache.nifi.components.PropertyDescriptorprivate static final intprivate static final Duration(package private) static final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.PropertyDescriptorprivate com.azure.messaging.eventhubs.EventHubConsumerClient(package private) static final org.apache.nifi.components.PropertyDescriptorprivate static final Stringprivate final BlockingQueue<String> (package private) static final org.apache.nifi.components.PropertyDescriptorprivate static final List<org.apache.nifi.components.PropertyDescriptor> (package private) static final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.PropertyDescriptorprivate intprivate Duration(package private) static final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> (package private) static final org.apache.nifi.components.PropertyDescriptorprivate static final String(package private) static final org.apache.nifi.components.PropertyDescriptorFields inherited from interface org.apache.nifi.shared.azure.eventhubs.AzureEventHubComponent
PROXY_CONFIGURATION_SERVICE, PROXY_SPECS, TRANSPORT_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate voidprivate com.azure.messaging.eventhubs.EventHubClientBuildercreateEventHubClientBuilder(org.apache.nifi.processor.ProcessContext context) protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context) getAttributes(com.azure.messaging.eventhubs.models.PartitionEvent partitionEvent) private Stringprotected BlockingQueue<String> Get Partition Identifiers from Event Hub Consumer Client for pollingSet<org.apache.nifi.processor.Relationship> final List<org.apache.nifi.components.PropertyDescriptor> private StringgetTransitUri(String partitionId) private booleanvoidonPrimaryNodeStateChange(org.apache.nifi.annotation.notification.PrimaryNodeState primaryNodeState) voidonScheduled(org.apache.nifi.processor.ProcessContext context) voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) protected Iterable<com.azure.messaging.eventhubs.models.PartitionEvent> receiveEvents(String partitionId) Receive Events from specified partition is synchronized to avoid concurrent requests for the same partitionMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
TRANSIT_URI_FORMAT_STRING
- See Also:
-
DEFAULT_FETCH_TIMEOUT
-
DEFAULT_FETCH_SIZE
private static final int DEFAULT_FETCH_SIZE- See Also:
-
NODE_CLIENT_IDENTIFIER_FORMAT
- See Also:
-
EVENT_HUB_NAME
static final org.apache.nifi.components.PropertyDescriptor EVENT_HUB_NAME -
NAMESPACE
static final org.apache.nifi.components.PropertyDescriptor NAMESPACE -
SERVICE_BUS_ENDPOINT
static final org.apache.nifi.components.PropertyDescriptor SERVICE_BUS_ENDPOINT -
ACCESS_POLICY
static final org.apache.nifi.components.PropertyDescriptor ACCESS_POLICY -
POLICY_PRIMARY_KEY
static final org.apache.nifi.components.PropertyDescriptor POLICY_PRIMARY_KEY -
USE_MANAGED_IDENTITY
static final org.apache.nifi.components.PropertyDescriptor USE_MANAGED_IDENTITY -
CONSUMER_GROUP
static final org.apache.nifi.components.PropertyDescriptor CONSUMER_GROUP -
ENQUEUE_TIME
static final org.apache.nifi.components.PropertyDescriptor ENQUEUE_TIME -
RECEIVER_FETCH_SIZE
static final org.apache.nifi.components.PropertyDescriptor RECEIVER_FETCH_SIZE -
RECEIVER_FETCH_TIMEOUT
static final org.apache.nifi.components.PropertyDescriptor RECEIVER_FETCH_TIMEOUT -
REL_SUCCESS
static final org.apache.nifi.processor.Relationship REL_SUCCESS -
propertyDescriptors
-
relationships
-
partitionEventPositions
-
partitionIds
-
configuredExecutionNode
-
receiverFetchSize
private volatile int receiverFetchSize -
receiverFetchTimeout
-
configuredClientBuilder
private com.azure.messaging.eventhubs.EventHubClientBuilder configuredClientBuilder -
eventHubConsumerClient
private com.azure.messaging.eventhubs.EventHubConsumerClient eventHubConsumerClient
-
-
Constructor Details
-
GetAzureEventHub
public GetAzureEventHub()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
onPrimaryNodeStateChange
@OnPrimaryNodeStateChange public void onPrimaryNodeStateChange(org.apache.nifi.annotation.notification.PrimaryNodeState primaryNodeState) -
closeClient
@OnStopped public void closeClient() -
onScheduled
@OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context) -
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
getPartitionIds
Get Partition Identifiers from Event Hub Consumer Client for polling- Returns:
- Queue of Partition Identifiers
-
receiveEvents
protected Iterable<com.azure.messaging.eventhubs.models.PartitionEvent> receiveEvents(String partitionId) Receive Events from specified partition is synchronized to avoid concurrent requests for the same partition- Parameters:
partitionId- Partition Identifier- Returns:
- Iterable of Partition Events or empty when none received
-
createClient
private void createClient() -
isCreateClientEnabled
private boolean isCreateClientEnabled() -
createEventHubClientBuilder
private com.azure.messaging.eventhubs.EventHubClientBuilder createEventHubClientBuilder(org.apache.nifi.processor.ProcessContext context) -
getTransitUri
-
getClientIdentifier
-
getAttributes
-