> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sync.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Apache Kafka

export const CommonDatasourceMoreInformation = ({datasource = "the data source", advancedurl = "", siteName = "CData Sync", driverVersion = ""}) => {
  return <>
      <p>
        For more information about interactions between {siteName} and {datasource}, see{' '}
        <a href={`https://cdn.cdata.com/help/${advancedurl}${driverVersion}/synch/default.htm`}>
          {datasource} Connector for {siteName}
        </a>.
      </p>
    </>;
};

export const CommonAuthSchemeAzureserviceprincipalcert = () => {
  return <>
      <p>To connect with an Azure service principal and client certificate, set the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>AzureServicePrincipalCert</strong>.</li>
        <li><strong>Azure Tenant:</strong> Enter the Microsoft Online tenant to which you want to connect.</li>
        <li><strong>OAuth Client Id:</strong> Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.</li>
        <li><strong>OAuth JWT Cert:</strong> Enter your Java web tokens (JWT) certificate store.</li>
        <li><strong>OAuth JWT Cert Type:</strong> Enter the type of key store that contains your JWT Certificate. The default type is <strong>PEMKEY_BLOB</strong>.</li>
        <li>(Optional) <strong>OAuth JWT Cert Password:</strong> Enter the password for your OAuth JWT certificate.</li>
        <li>(Optional) <strong>OAuth JWT Cert Subject:</strong> Enter the subject of your OAuth JWT certificate.</li>
      </ul>
      <p>To obtain the OAuth certificate for your application:</p>
      <ol>
        <li>Log in to the <a href="https://portal.azure.com" target="_blank" rel="noopener noreferrer">Azure portal</a>.</li>
        <li>In the left navigation pane, select <strong>All services</strong>. Then, search for and select <strong>App registrations</strong>.</li>
        <li>Click <strong>New registrations</strong>.</li>
        <li>Enter an application name and select <strong>Any Azure AD Directory - Multi Tenant</strong>.</li>
        <li>After you create the application, copy the application (client) Id value that is displayed in the <strong>Overview</strong> section. Use this value as the OAuth client Id.</li>
        <li>Navigate to the <strong>Certificates & Secrets</strong> section and select <strong>Upload certificate</strong>. Then, select the certificate to upload from your local machine.</li>
        <li>Specify the duration and save the client secret. After you save it, the key value is displayed.</li>
        <li>Copy this value because it is displayed only once. You will use this value as the OAuth client secret.</li>
        <li>On the <strong>Authentication</strong> tab, make sure to select <strong>Access tokens (used for implicit flows)</strong>.</li>
      </ol>
    </>;
};

export const CommonAuthSchemeAzureserviceprincipal = () => {
  return <>
      <p>To connect with an Azure service principal and client secret, set the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>AzureServicePrincipal</strong>.</li>
        <li><strong>Azure Tenant:</strong> Enter the Microsoft Online tenant to which you want to connect.</li>
        <li><strong>OAuth Client Id:</strong> Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.</li>
        <li><strong>OAuth Client Secret:</strong> Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.</li>
      </ul>
      <p>To obtain the OAuth client Id and client secret for your application:</p>
      <ol>
        <li>Log in to the <a href="https://portal.azure.com" target="_blank" rel="noopener noreferrer">Azure portal</a>.</li>
        <li>In the left navigation pane, select <strong>All services</strong>. Then, search for and select <strong>App registrations</strong>.</li>
        <li>Click <strong>New registrations</strong>.</li>
        <li>Enter an application name and select <strong>Any Azure AD Directory - Multi Tenant</strong>.</li>
        <li>After you create the application, copy the application (client) Id value that is displayed in the <strong>Overview</strong> section. Use this value as the OAuth client Id.</li>
        <li>Navigate to the <strong>Certificates & Secrets</strong> section and select <strong>New Client Secret</strong> for the application.</li>
        <li>Specify the duration and save the client secret. After you save it, the key value is displayed.</li>
        <li>Copy this value because it is displayed only once. You will use this value as the OAuth client secret.</li>
        <li>On the <strong>Authentication</strong> tab, make sure to select <strong>Access tokens (used for implicit flows)</strong>.</li>
      </ol>
    </>;
};

export const CommonAuthSchemeAzuremsi = ({siteName = "CData Sync"}) => {
  return <>
      <p>
        To leverage Azure Managed Service Identity (MSI) when {siteName} is running on an Azure
        virtual machine, select <strong>Azure MSI</strong> for <strong>Auth Scheme</strong>. No
        additional properties are required.
      </p>
    </>;
};

export const CommonAuthSchemePlain = ({siteName = "CData Sync", siteNameShort = "Sync", datasource = "the data source"}) => {
  return <>
      <p>To connect with a plain-text login, specify these properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>Plain</strong>.</li>
        <li><strong>User:</strong> Enter the username that you use to authenticate to your {datasource} account.</li>
        <li><strong>Password:</strong> Enter the password that you use to authenticate to your {datasource} account.</li>
      </ul>
    </>;
};

export const CommonAuthSchemeNone = ({siteName = "CData Sync", siteNameShort = "Sync", datasource = "the data source"}) => {
  return <>
      <p>To connect without authentication, select <strong>None</strong> for <strong>Auth Scheme</strong>. No additional properties are required.</p>
    </>;
};

export const CommonDatasourceAddConnector = ({datasource = "the data source", title = "the connector", destination = false, siteNameShort = "Sync"}) => {
  return <>
      <p>
        To enable {siteNameShort} to use data from {datasource}, you first must add the
        connector, as follows:
      </p>
      <ol>
        <li>Open the <strong>Connections</strong> page of the {siteNameShort} dashboard.</li>
        <li>Click <strong>Add Connection</strong> to open the <strong>Select Connectors</strong> page.</li>
        <li>
          Click the <strong>{destination ? "Destinations" : "Sources"}</strong> tab and locate
          the <strong>{title}</strong> row.
        </li>
        <li>
          Click the <strong>Configure Connection</strong> icon at the end of that row to open
          the <strong>New Connection</strong> page. This action opens the{' '}
          <strong>Add Connection</strong> dialog box.
          <br />
          <strong>Note:</strong> If the <strong>Configure Connection</strong> icon is not
          available, click the <strong>Download Connector</strong> icon to install
          the {title} connector.
        </li>
        <li>Enter a name for your connection in the <strong>Add Connection</strong> dialog box.</li>
        <li>Click <strong>Add</strong> to open the <strong>Settings</strong> tab for your connector.</li>
      </ol>
      <p>
        For more information about installing new connectors, see{' '}
        <a href="../connections">Connections</a>.
      </p>
    </>;
};

export const CommonDatasourceIntroDestination = ({datasource = "the data source", siteName = "CData Sync"}) => {
  return <p>
      You can use the {datasource} connector from the {siteName} application to move data
      from any supported source to the {datasource} destination. To do so, you need to add
      the connector, authenticate to the connector, and complete your connection.
    </p>;
};

export const driverVersion = "M";

export const siteNameShort = "Sync";

export const siteName = "CData Sync";

<CommonDatasourceIntroDestination datasource="Apache Kafka" siteName={siteName} />

**Note:** With this connector, you can authenticate either to Kafka or to Azure Event Hubs.

## Add the Apache Kafka Connector

<CommonDatasourceAddConnector datasource="Apache Kafka" title="Apache Kafka" destination={true} siteNameShort={siteNameShort} />

## Authenticate to Apache Kafka

After you add the connector, you need to set the required properties.

**Bootstrap Servers:** Enter the address of the Apache Kafka Bootstrap servers to which you want to connect.

{siteName} supports authenticating to Apache Kafka in several ways. Select your authentication method below to proceed to the relevant section that contains the authentication details.

* [**None**](#none) (default)
* [**Plain**](#plain)
* [**SCRAM**](#scram)
* [**SCRAM-SHA-512**](#scram-sha-512)
* [**Kerberos**](#kerberos)

### None

<CommonAuthSchemeNone siteName={siteName} />

### Plain

<CommonAuthSchemePlain siteName={siteName} datasource="Apache Kafka" />

### SCRAM

To connect with SCRAM (SHA-256) credentials, specify these properties:

* **Auth Scheme:** Select **SCRAM**.
* **User:** Enter the username that you use to authenticate to your Apache Kafka account.
* **Password:** Enter the password that you use to authenticate to your Apache Kafka account.

### SCRAM-SHA-512

To connect with the SCRAM (SHA-512) credentials, specify these properties:

* **Auth Scheme:** Select SCRAM-SHA-512.
* **User:** Enter the username that you use to authenticate to your Apache Kafka account.
* **Password:** Enter the password that you use to authenticate to your Apache Kafka account.

### Kerberos

To connect with Kerberos, specify these properties:

* **Auth Scheme:** Select **Kerberos**.
* **Kerberos SPN:** Enter the service principal name (SPN) for the Kerberos domain controller.
* **Kerberos Service Name:** Enter the name of the Kerberos service with which you want to authenticate.
* (Optional) **Kerberos Keytab File:** Enter the keytab file that contains your pairs of the Kerberos principals and encrypted keys.
* (Optional) **Use Kerberos Ticket Cache:** Select **True** to use a ticket cache with the logged-in user instead of a keytab file. The default value is **False**.

## Authenticate to Azure Event Hubs

After you add the connector, you need to set the following required properties to connect to Azure Event Hubs:

* **Connection Name:** Enter a connection name of your choice.
* **Bootstrap Servers:** Enter the address of the Apache Kafka bootstrap servers to which you want to connect.

{siteName} supports authenticating to Apache Event Hubs in several ways. Select your authentication method below to proceed to the relevant section that contains the authentication details.

* [**SSL Certificate**](#ssl-certificate)
* [**Azure Active Directory**](#azure-active-directory)
* [**Azure Managed Service Identity**](#azure-managed-service-identity)
* [**Azure Service Principal**](#azure-service-principal)
* [**Azure Service Principal Certificate**](#azure-service-principal-certificate)

### SSL Certificate

To connect with a Secure Sockets Layer (SSL) client certificate, specify these properties:

* **Auth Scheme:** Select **SSLCertificate**.
* **SSL Client Cert:** Enter the SSL client certificate that is used to validate to the Apache Kafka broker.
* **SSL Client Cert Type:** Select the format of the SSL client certificate that is used to connect to the Apache Kafka broker:
  * **JKSFILE**
  * **PFXFILE**
  * **PEMKEY\_FILE** (default)
  * **PEMKEY\_BLOB**
* (Optional) **SSL Client Cert Password:** Enter the password that is used to decrypt the SSL client certificate.

### Azure Active Directory

To connect with Azure Active Directory (AD) credentials, specify the following properties:

* **Azure Tenant:** Enter the Microsoft Online tenant that is used to access data. If you do not specify a tenant, {siteNameShort} uses the default tenant.
* **OAuth Client Id:** Enter the client Id that you were assigned when you registered your application with an OAuth authorization server.
* **OAuth Client Secret:** Enter the client secret that you were assigned when you registered your application with an OAuth authorization server.

### Azure Managed Service Identity

<CommonAuthSchemeAzuremsi siteName={siteName} />

### Azure Service Principal

<CommonAuthSchemeAzureserviceprincipal siteName={siteName} />

### Azure Service Principal Certificate

<CommonAuthSchemeAzureserviceprincipalcert siteName={siteName} />

## Extracting Metadata from Topics

Reads in Apache Kafka do not have a natural stopping point. To avoid perpetual Read operations, items are read until either the **ReadDuration** property or the **Timeout** property expires. By default, **ReadDuration** is set to 30 seconds.

* The Apache Kafka driver models topics as tables and messages as rows, and it facilitates this behavior in two ways:
* For services that contain a schema registry (for example, Confluent and instances hosted by Amazon Web Services), the schema is read directly from the schema registry.

For services that do not contain a schema registry, the driver infers the schema.

### Schema Registry

The schema registry contains a list of topics that have registered schemas. The list of tables and columns are simply read directly from the schema registry.

To connect to a service with a schema registry, specify the following properties:

* **Bootstrap Servers:** Enter the server (host name or IP address) and port (in the format *Server:Port*) of the Apache Kafka bootstrap servers.
* **Type Detection Scheme:** Select **SchemaRegistry**. **This scheme is the only one that is supported for the Apache Kafka destination.** If you select any other scheme, {siteNameShort} generates an error.

  The **SchemaRegistry** scheme determines the Schema Registry API and uses a list of predefined AVRO schemas. For this scheme, specify the following properties:

  * **Registry Url:** Enter the URL to the server for the schema registry. When you specify this property, {siteNameShort} reads the Apache Kafka schema from the server.
  * **Registry Service:** Select the Schema Registry service that you want to use for working with topic schemas.
    * **Confluent** (default)
    * **AWSGlue**
  * **Registry Auth Scheme:** Select the scheme that you want to use to authenticate to the schema registry.
    * **None** (default)\***:** This scheme specifies that no authentication is used.
    * **Basic:** For this scheme, specify the following properties:
      * **Registry User:** Enter the username that you use to authenticate with the server that you specified earlier for **Registry Url**.
      * **Registry Password:** Enter the password that you use to authenticate with the server that you specified earlier for **Registry Url**.
    * **SSLCertificate:** This scheme specifies that SSL client-certificate authentication should be used. For this setting, you must specify the following:
      * **Registry Client Cert:** Enter the TLS/SSL client certificate store for SSL client authentication (two-way SSL) with the schema registry.
      * (Optional) **Registry Client Cert Password:** Enter the password for your TLS/SSL client certificate.
      * (Optional) **Registry Client Cert Subject** Enter the subject of your TLS/SSL client certificate.

### Confluent Schema Registry

When you connect to Confluent Cloud, the registry URL corresponds to the Schema Registry endpoint value that is located in **Schemas > Schema Registry > Instructions**.

The Confluent schema registry supports several authentication options. Typically, Confluent Cloud deployments require that you set the **Registry Auth Scheme** property to **Basic**, along with a registry user and registry password. To find your user and password, navigate to **Schemas > Schema Registry > API Access** and locate the access-key and secret-key values.

On-premises deployments might not require authentication. In these configurations, you should set **Registry Auth Scheme** to **None**. These deployments might require SSL client certificates also. For that, you need to set the **SSL Certificate** registry auth scheme as well as the **Registry Client Cert** and **Registry Client Cert Type** options.

### Amazon Web Services (AWS) Glue Schema Registry

When you connect to AWS Glue, the registry URL corresponds to the Amazon Resources Name (ARN) value of the registry.

The AWS Glue schema registry only supports the **Basic** registry auth scheme. You should set **Registry User** and **Registry Password**, respectively, to the access key and secret key of a user that has access to the registry.

## Complete Your Connection

To complete your connection:

1. Specify the following properties:
   * **Type Detection Scheme:** For the Kafka destination, the only supported scheme is **SchemaRegistry**. If you select another scheme, {siteNameShort} generates an error. For details about using this scheme, see [Schema Registry](#schema-registry).
   * (Optional) **Schema Merge Mode:** Select the mode by which you want to merge multiple schemas.
     * **None** (default)
     * **Simple**
   * **Use SSL:** Select whether you want to enable Secure Sockets Layer (SSL). By default, the **Enable** checkbox is not selected.
2. Define advanced connection settings on the **Advanced** tab. (In most cases, though, you should not need these settings.)
3. If you authenticate with AzureAD, click **Connect to Apache Kafka** to connect to your Apache Kafka account.
4. Click **Create & Test** to create your connection.

## More Information

<CommonDatasourceMoreInformation datasource="Apache Kafka" advancedurl="SK" siteName={siteName} driverVersion={driverVersion} />
