Azure Event Hub
This guide provides step-by-step instructions to set up and use Azure Event Hub with Mage. By following these instructions, you can create a new streaming pipeline in Mage, authenticate with Azure Event Hub, and configure your data loader, transformer, and exporter blocks to process and manage your data efficiently.
Start Mage
- Open Mage in your browser and then navigate to the pipelines page.
- Create a new pipeline by clicking the “+ New” button and then select “Streaming.”
- Enter a name for the pipeline and click “Create.”
Authentication To authenticate with Azure Event Hub, complete the following actions:
- Configure your io_config.yml file with the account variables below. If you need further information about how to store secrets in Mage check out the documentation.
- Add a data loader block to your pipeline and then select “Azure Event Hub” as the source.
- Complete the data loader block with the information below.
Connection string: Use the connection_str
parameter in the config as shown above. You can obtain this from your Azure portal.
- Add the template transformer block or create a custom block to transform data from Azure Event Hub
- The template will populate with the code below. Make adjustments to your specific requirements.
- Add a data exporter block and select “Dummy”
- Use the default setting as seen below.
Additional Configuration Options
These additional configuration options are specifically for the data loader block that uses the Azure Event Hub connector. They should be added to the YAML configuration of your data loader block.
- prefetch: This determines the maximum number of events to retrieve in a single batch when reading from Event Hub.
- max_wait_time: This sets the maximum time to wait for a batch to be filled before returning.
- starting_position: This optional parameter specifies where to start reading events from in the Event Hub.
- Common starting positions include:
- -1 or @latest: Start from the end of the stream
- -2 or @earliest: Start from the end of the stream
- Common starting positions include:
By following this guide, you can successfully set up a streaming pipeline in Mage using Azure Event Hub. This allows you to authenticate, load, transform, and export data efficiently. With these steps, you can leverage Mage and Azure Event Hub to create powerful and scalable streaming data pipelines.
Was this page helpful?