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 Details

    • TRANSIT_URI_FORMAT_STRING

      private static final String TRANSIT_URI_FORMAT_STRING
      See Also:
    • DEFAULT_FETCH_TIMEOUT

      private static final Duration DEFAULT_FETCH_TIMEOUT
    • DEFAULT_FETCH_SIZE

      private static final int DEFAULT_FETCH_SIZE
      See Also:
    • NODE_CLIENT_IDENTIFIER_FORMAT

      private static final String 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

      private static final List<org.apache.nifi.components.PropertyDescriptor> propertyDescriptors
    • relationships

      private static final Set<org.apache.nifi.processor.Relationship> relationships
    • partitionEventPositions

      private final Map<String,com.azure.messaging.eventhubs.models.EventPosition> partitionEventPositions
    • partitionIds

      private final BlockingQueue<String> partitionIds
    • configuredExecutionNode

      private final AtomicReference<org.apache.nifi.scheduling.ExecutionNode> configuredExecutionNode
    • receiverFetchSize

      private volatile int receiverFetchSize
    • receiverFetchTimeout

      private volatile Duration 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

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • getSupportedPropertyDescriptors

      public final List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • customValidate

      protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context)
      Overrides:
      customValidate in class org.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:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • getPartitionIds

      protected BlockingQueue<String> 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

      private String getTransitUri(String partitionId)
    • getClientIdentifier

      private String getClientIdentifier()
    • getAttributes

      private Map<String,String> getAttributes(com.azure.messaging.eventhubs.models.PartitionEvent partitionEvent)