Soru

Zorluk: OrtaImplement Azure Event Hubs Solutions

An energy management company is deploying a distributed system to monitor smart meter readings. Telemetry data is streamed to an Azure Event Hub, and you must build a C# subscriber application using the Azure.Messaging.EventHubs SDK to process the data in parallel across multiple virtual machine instances. The application must ensure that partitions are balanced dynamically among the running instances and that event processing resumes from the last known checkpoint in the event of an instance failure. Which of the following actions are required to implement the event consumer using the EventProcessorClient class? Select two.

  1. Initialize a BlobContainerClient that points to an Azure Blob Storage container, and pass it to the constructor of EventProcessorClient.Cevap
  2. Assign event handlers to the ProcessEventAsync and ProcessErrorAsync events on the EventProcessorClient instance before starting execution.Cevap
  3. C
    Utilize the BlobLeaseClient class in the application code to manually acquire, renew, and release leases on the partition checkpoint blobs.
  4. D
    Configure the application to authenticate using a system-assigned managed identity that is shared across all virtual machines hosting the consumer.

Cevap

Initialize a BlobContainerClient pointing to the storage container and pass it to the EventProcessorClient, and register event handler delegates for both ProcessEventAsync and ProcessErrorAsync before starting the processor.
To consume events using the EventProcessorClient class, you must provide a BlobContainerClient pointing to an Azure Blob Storage container. The client uses this container to store partition ownership and checkpoint data. Additionally, before calling StartProcessingAsync, you must register event handler delegates for both ProcessEventAsync (to process events) and ProcessErrorAsync (to handle errors) as they are mandatory for the processor to function.

Adım Adım Çözüm

1
Create a BlobContainerClient instance pointing to the designated Azure Blob Storage container.
An initialized BlobContainerClient that is ready to act as the checkpoint store.
The EventProcessorClient relies on Azure Blob Storage to maintain partition ownership via blob leases and to persist progress checkpoints.
2
Instantiate the EventProcessorClient, passing the BlobContainerClient along with the consumer group, namespace connection string, and Event Hub name.
An initialized EventProcessorClient instance.
The client requires the storage provider client to manage its state metadata during horizontal scale-out.
3
Register handler delegates to the ProcessEventAsync and ProcessErrorAsync event properties of the client.
Configured event handlers for processing telemetry and handling errors.
These handlers are required by the SDK; attempting to start the processing loop without them registered will result in a runtime exception.

Anahtar Kavram

Configuring the EventProcessorClient lifecycle with Blob Storage checkpointing and event handlers.
Bu soruyu puanla