@Soumya Prateek Raul - Thank you for sharing this information. It's good to know that you were able to override the default behavior of the new SDK by passing a function to eventProcessorClient.PartitionInitializingAsync
.
As you mentioned, the new SDK follows a different folder format for the checkpointing store than the old SDK. If you want to use the new SDK with the checkpoint data created by the old SDK, you need to migrate the checkpoint data to the new format. You can use the BlobCheckpointStore
class in the new SDK to store the checkpoint data in the new format.
Here's an example of how to use the BlobCheckpointStore
class to store the checkpoint data in the new format:
from azure.eventhub import EventHubConsumerClient
from azure.eventhub.extensions.checkpointstoreblob import BlobCheckpointStore
from azure.messaging.eventhubs import EventProcessorClient
# Create a BlobCheckpointStore object to store the checkpoint data in the new format
checkpoint_store = BlobCheckpointStore.from_connection_string(
"<connection-string>",
"<blob-container-name>"
)
# Create an EventProcessorClient object to read from the Event Hub
event_processor_client = EventProcessorClient(
eventhub_connection_str="<connection-string>",
consumer_group="<consumer-group-name>",
eventhub_name="<event-hub-name>",
checkpoint_store=checkpoint_store
)
# Start reading from the Event Hub
event_processor_client.start()
In this example,, you create a BlobCheckpointStore
object to store the checkpoint data in the new format, and then create an EventProcessorClient
object to read from the Event Hub. You pass the BlobCheckpointStore
object to the EventProcessorClient
constructor as the checkpoint_store
parameter.
After creating the EventProcessorClient
object, you call the start
method to start reading from the Event Hub.
I hope this helps! Let me know if you have any other questions.