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.