Class EventProcessorHost.EventProcessorHostBuilder

  • Enclosing class:
    EventProcessorHost

    public static final class EventProcessorHost.EventProcessorHostBuilder
    extends Object
    Builder class to create EventProcessorHost instances.

    To use, start with: EventProcessorHost.EventProcessorHostBuilder.newBuilder(...) Then either use the built-in Azure Storage-based lease and checkpoint managers, or user implementations. Then either supply an Event Hub connection string or use Azure Active Directory (AAD) authentication. If using AAD auth, either provide a callback or an ITokenProvider Finally, set various optional values as desired, then call build() to get an EventProcessorHost instance.

    • Method Detail

      • newBuilder

        public static EventProcessorHost.EventProcessorHostBuilder.ManagerStep newBuilder​(String hostName,
                                                                                          String consumerGroupName)
        The process of building starts here, with arguments that are always required.

        The hostName parameter is a name for this EventProcessorHost instance, which must be unique among all instances consuming from the same Event Hub and consumer group. The name must be unique because it is used to distinguish which instance owns the lease for a given partition of the event hub. An easy way to generate a unique host name is to call EventProcessorHost.createHostName("mystring").

        Parameters:
        hostName - a name for this host instance. See method notes.
        consumerGroupName - The consumer group for the Event Hub
        Returns:
        interface for setting the lease and checkpoint managers