Azure Data Lake Storage Gen2 Sink Connector for Confluent Cloud

Note

If you are installing the connector locally for Confluent Platform, see Azure Data Lake Storage Gen2 Sink Connector for Confluent Platform.

You can use the Azure Data Lake Storage Gen2 connector, currently available as a sink connector, to export data from Apache Kafka® topics to Azure Data Lake Storage Gen2 files in Avro, JSON or ByteArray formats. Depending on your configuration, the Azure Data Lake Storage Gen2 connector can export data by guaranteeing exactly-once delivery semantics to consumers of the Azure Data Lake Storage Gen2 files it produces.

The Azure Data Lake Storage Gen2 sink connector periodically polls data from Kafka and, in turn, uploads it to Azure Data Lake Storage Gen2. A partitioner is used to split the data of every Kafka partition into chunks. Each chunk of data is represented as an Azure Data Lake Storage Gen2 file. The key name encodes the topic, the Kafka partition, and the start offset of this data chunk. If no partitioner is specified in the configuration, the default partitioner which preserves Kafka partitioning is used. The size of each data chunk is determined by the number of records written to Azure Data Lake Storage Gen2 and by schema compatibility.

Important

Once this connector moves from Preview to Generally Availability (GA), it will require a subscription for Confluent Cloud commitment for Confluent Cloud Enterprise customers. Without a Confluent Cloud commitment, Confluent Cloud Enterprise customers will not have access to these connectors in GA. Contact your Confluent Account Executive to learn more and to update your subscription, if necessary.

Features

The Confluent Cloud Azure DataLake Gen2 Sink connector provides the following features:

  • Exactly Once Delivery: Records that are exported using a deterministic partitioner are delivered with exactly-once semantics regardless of the eventual consistency of Azure DataLake Gen2 Storage.
  • Data Format with or without Schema: The connector supports writing data to Azure DataLake Gen2 Storage in Avro, JSON, and Bytes. Schema validation is disabled for JSON.
  • Schema Evolution: schema.compatibility is set to NONE.
  • Time-Based Partitioner: The connector supports the TimeBasedPartitioner class based on the Kafka class TimeStamp.
  • Flush size: flush.size defaults to 1000. For example, if you use the default setting of 1000 and your topic has six partitions, files start to be created in storage after more than 1000 records exist in each partition. Note that the default value of 1000 can be increased if needed.

Refer to Cloud connector limitations for additional information.

Caution

Preview connectors are not currently supported and are not recommended for production use. For specific connector limitations, see Cloud connector limitations.

Quick Start

Use this quick start to get up and running with the Confluent Cloud Azure DataLake Gen2 Storage sink connector. The quick start provides the basics of selecting the connector and configuring it to stream events to Azure storage.

Prerequisites
  • Authorized access to a Confluent Cloud cluster on Microsoft Azure.
  • The Confluent Cloud CLI installed and configured for the cluster. See Install and Configure the Confluent Cloud CLI.
  • Azure Data Lake storage should be in the same region as your Confluent Cloud cluster. If you use a different region, be aware that you may incur additional data transfer charges. Contact Confluent Support if you need to use Confluent Cloud and Azure Data Lake storage in different regions.
  • An Azure Shared Access Signatures (SAS) key to access Data Lake storage. For more information, see Grant limited access to Azure Storage resources using shared access signatures (SAS).
  • Either one of the following to use for the Kafka cluster credentials fields:
    • A Confluent Cloud API key and secret. After you have created your cluster, go to Cluster settings > API access > Create Key.
    • A Confluent Cloud service account.

Using the Confluent Cloud GUI

Step 1: Launch your Confluent Cloud cluster.

See the Confluent Cloud Quick Start for installation instructions.

Step 2: Add a connector.

Click Connectors > Add connector.

Add a connector

Step 3: Select your connector.

Click the Azure Data Lake Gen2 Storage Sink connector icon.

Step 4: Set up the connection.

Complete the following and click Continue.

Note

  • Make sure you have all your prerequisites completed.
  • An asterisk (*) designates a required entry.
  1. Select one or more topics.
  2. Enter a Connector Name.
  3. Enter your Kafka Cluster credentials. The credentials are either the API key and secret or the service account API key and secret.
  4. Select the message format for messages coming from the Kafka topic.
  5. Provide your Azure Data Lake Gen2 details. The Topics Directory is a directory in Data Lake storage where messages are stored. This entry defaults to topics. The connector creates subdirectories in topics based on the Kafka topic names.
  6. Select the output message format for stored messages.
  7. Select the Time interval that sets how you want your messages grouped in the topics directory. For example, if you select Hourly, messages are grouped into folders for each hour data is streamed to storage.
  8. Enter the Flush size. This value defaults to 1000. For example, if you use the default setting of 1000 and your topic has six partitions, files start to be created in storage after more than 1000 records exist in each partition. Note that the default value of 1000 can be increased if needed.
  9. Enter the maximum number of tasks for the connector. Refer to Cloud connector limitations for additional information.

Configuration properties that are not shown in the Confluent Cloud UI use the default values. See Azure DataLake Gen2 Storage Sink Configuration Properties for default values and property definitions.

Step 5: Launch the connector.

Verify the connection details and click Launch.

Verify the connection details

Step 6: Check the connector status.

The status for the connector should go from Provisioning to Running.

Step 7: Check the Azure storage container.

  1. From the Azure portal, go to your Azure storage account.

  2. Open each folder until you see your messages displayed.

    Check the storage container

For additional information about this connector see Azure Data Lake Storage Gen2 Sink Connector for Confluent Platform. Note that not all Confluent Platform connector features are provided in the Confluent Cloud connector.

See also

For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud KSQL, see the Cloud ETL demo. The demo also shows how to use Confluent Cloud CLI to manage your resources in Confluent Cloud.

Using the Confluent Cloud CLI

Complete the following steps to set up and run the connector using the Confluent Cloud CLI.

Note

Make sure you have all your prerequisites completed.

Step 1: List the available connectors.

Enter the following command to list available connectors:

ccloud connector-catalog list

Step 2: Show the required connector configuration properties.

Enter the following command to show the required connector properties:

ccloud connector-catalog describe <connector-catalog-name>

For example:

ccloud connector-catalog describe AzureDataLakeGen2Sink

Example output:

Following are the required configs:
connector.class: AzureDataLakeGen2Sink
name
kafka.api.key
kafka.api.secret
topics
input.data.format
azure.datalake.gen2.account.name
azure.datalake.gen2.sas.keyname
azure.datalake.gen2.sas.key
output.data.format
time.interval
tasks.max

Configuration properties that are not listed use the default values. See Azure DataLake Gen2 Storage Sink Configuration Properties for default values and property definitions.

Step 3: Create the connector configuration file.

Create a JSON file that contains the connector configuration properties. The following example shows the required connector properties.

{
    "name": "adls-sink-connector",
    "connector.class": "AzureDataLakeGen2Sink",
    "kafka.api.key": "<my-kafka-api-key>",
    "kafka.api.secret": "<my-kafka-api-secret>",
    "topics": "pageviews",
    "input.data.format": "AVRO",
    "azure.datalake.gen2.account.name": "<account-name>",
    "azure.datalake.gen2.sas.keyname": "<sas-key-name>",
    "azure.datalake.gen2.sas.key": "<sas-key>",
    "topics.dir": "topics",
    "output.data.format": "AVRO",
    "time.interval": "HOURLY",
    "flush.size": "1000",
    "tasks.max": "1"
  }

Note the following property definitions:

  • "name": Sets a name for your new connector.
  • "connector.class": Identifies the connector plugin name.
  • "topics": Identifies the topic name or a comma-separated list of topic names.
  • "input.data.format": Sets the input message format. Valid entries are AVRO, JSON, or BYTES.
  • "topics.dir": The example above shows the default entry topics. In this example, the directory hierarchy created is topics/pageviews. Each Kafka topic will have a separate subdirectory based on the Kafka topic name.
  • "output.data.format": Sets the output message format. Valid entries are AVRO, JSON, or BYTES.
  • "time.interval": Sets how your messages are grouped in the Azure container. Valid entries are DAILY or HOURLY.
  • "flush.size": 1000 is a typical value to use for flush size. For example, if you use the setting of 1000 and your topic has six partitions, files start to be created in storage after more than 1000 records exist in each partition.
  • "tasks.max": Enter the maximum number of connector tasks to use. Refer to Cloud connector limitations for additional information.

Step 4: Load the properties file and create the connector.

Enter the following command to load the configuration and start the connector:

ccloud connector create --config <file-name>.json

For example:

ccloud connector create --config adls-sink-config.json

Example output:

Created connector adls-sink-connector jtt-ix4dl

Step 5: Check the connector status.

Enter the following command to check the connector status:

ccloud connector list

Example output:

ID          |       Name                | Status  | Type
+-----------+---------------------------+---------+------+
jtt-ix4dl   | adls-sink-connector       | RUNNING | sink

Step 6: Check the Azure storage container.

  1. From the Azure portal, go to your Azure storage account.

  2. Open each folder until you see your messages displayed.

    Check the storage container

For additional information about this connector see Azure Data Lake Storage Gen2 Sink Connector for Confluent Platform. Note that not all Confluent Platform connector features are provided in the Confluent Cloud connector.

Next Steps

Try out a Confluent Cloud demo.

See also

For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud KSQL, see the Cloud ETL demo. The demo also shows how to use Confluent Cloud CLI to manage your resources in Confluent Cloud.