Replaying archived stream data
Event Hubs stores up to 7 days of data, which can be replayed using the EventHub consumer client libraries. Here is a simple Python example:
Consumer_client = EventHubConsumerClient.from_connection_string( conn_str=CONNECTION_STR, consumer_group='$Default', eventhub_name=EVENTHUB_NAME, ) consumer_client.receive( on_event=on_event, partition_id="0", starting_position="-1" # "-1" is the start of the partition. )
You can specify offsets or timestamps for the starting_position
value.
You can learn more about the Python EventHub APIs at https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html.
Let's take a look at some of the common data transformations that are possible using streaming analytics.