# Kafka Consumer

The Kafka Consumer component consumes the data from the given Kafka topic. It can consume the data from the same environment and external environment with CSV, JSON, XML, and Avro formats. This comes under the Consumer component group.

All component configurations are classified broadly into the following sections:

* ​[​Basic Information​](../component-base-configuration)​
* Meta Information
* ​[Resource Configuration​](../resource-configuration)​

Check out the steps provided in the demonstration to configure the Kafka Consumer component.

<figure><img src="https://859511478-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FBgLrAPQMJ3IP32CZsbna%2FKafka%20Consumer%20Component%20GIF.gif?alt=media&#x26;token=2927c314-6cbb-4533-aeaa-589749db0eb9" alt=""><figcaption><p>Configuring the Kafka Consumer component</p></figcaption></figure>

{% hint style="info" %}
_<mark style="color:green;">Please Note</mark><mark style="color:green;">:</mark> It currently supports **SSL** and **Plaintext** as **Security types**._
{% endhint %}

<figure><img src="https://859511478-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FiaDIOtqwZJRUXzuB5jZ1%2Fimage.png?alt=media&#x26;token=c8269b26-67ab-4c99-ba1e-69bc8225dac0" alt=""><figcaption><p>Component being used to read data from the external broker.</p></figcaption></figure>

This Component can read the data from external Brokers as well with SSL as the security type and host Aliases:

<figure><img src="https://859511478-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FtoYhWyiNVrr7iOcWjKRc%2Fimage.png?alt=media&#x26;token=7aef7040-44b3-40d1-9599-652f25d5e2ac" alt=""><figcaption><p>Kafka consumer Meta Information tab</p></figcaption></figure>

## Steps to Configure <a href="#steps-to-configure" id="steps-to-configure"></a>

* Drag and drop the Kafka Consumer Component to the Workflow Editor. ![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FvVe5hXOH3RTwAFjuAIlI%2F0.png?alt=media)
* Click on the dragged Kafka Consumer component to get the component properties tabs.
* Configure the _**Basic Information**_ tab.
* Select an Invocation type from the drop-down menu to confirm the running mode of the component. Select the _**Real-Time**_ option from the drop-down menu.
* **Deployment Type**: It displays the deployment type for the component. This field comes pre-selected.
* **Container Image Version**_**:**_ It displays the image version for the docker container. This field comes pre-selected.
* **Failover Event**: Select a failover Event from the drop-down menu.
* **Batch Size (min 10)**: Provide the maximum number of records to be processed in one execution cycle (Min limit for this field is 10
* **Enable Auto-Scaling**: Component pod scale up automatically based on a given max instance, if component lag is more than 60%.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FecmaqRoPMJlAFMXxeG52%2F1.png?alt=media)

* Click on the _**Meta Information tab**_ to open the properties fields and configure the **Meta Information tab** by providing the required fields.
* **Topic Name:** Specify the topic name that the user wants to consume data from Kafka.
* **Start From:** It contains the following start from:
* **Processed:** Using this option consumes live processed data and already processed data that has never been consumed by the component and
* **Beginning:** Using this option consumes live processed data and already processed data from the beginning
* **Latest:** Using this option consumes the latest processed data.
* **Timestamp:** Using this option consumes data between given interval times.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2Fe4GkuqaP4183u5Ma4fny%2F2.png?alt=media)

* **Is External:** The user can consume external topic data from the external bootstrap server by enabling the _**Is External**_ option. The _**Bootstrap Server**_ and _**Config**_ fields will display after enabling the _**Is External**_ option.
* **Bootstrap Server:** Enter external bootstrap details.
* **Config:** Enter configuration details of external details.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FsYU2bBXwIPwjCe5wkMLU%2F3.png?alt=media)

* **Input Record Type:** It contains the following input record types:
* **CSV:** The user can consume CSV data using this option. The _**Headers**_ and _**Separator**_ fields will display if the user selects choose CSV input record type.
  * **Header:** In this field, the user can enter column names of CSV data that consume from the Kafka topic.
  * **Separator:** In this field, the user can enter separators like comma (,) that used CSV data.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FsG9aO0RxleVz6MR7WalW%2F4.png?alt=media)

* **JSON:** The user can consume JSON data using this option.
* **XML:** The user can consume parquet data using this option.
* **AVRO:** The user can consume Avro data using this option.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FjRdZZFLycg4WviwmIEue%2F5.png?alt=media)

* **Security Type:** It contains the following security types:
  * **Plain Text:** Choose **the** Plain Text option if there environment without SSL.
  * **Host Aliases**: This option contains the following fields:
  * **IP:** Provide the IP address.
  * **Host Names:** Provide the Host Names.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FIzRkzt1WXzByZLmM22EW%2F6.png?alt=media)

* **SSL:** Choose the SSL option if there environment with SSL. It will display the following fields:
  * **Trust Store Location:** Provide the trust store path.
  * **Trust Store Password:** Provide the trust store password.
  * **Key Store Location:** Provide the key store path.
  * **Key Store Password:** Provide the key store password.
  * **SSL Key Password:** Provide the SSL key password.
  * **Host Aliases:** This option contains the following fields:
  * **IP:** Provide the IP.
  * **Host Names:** Provide the host names.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FCNYyH4OyyPAjwJ1OhMOs%2F7.png?alt=media)

{% hint style="info" %}
_<mark style="color:green;">Please Note:</mark> The **Host Aliases** can be used with **SSL** and **Plain text** Security types._
{% endhint %}

* After doing all the configurations click the _**Save Component in Storage**_ icon provided in the configuration panel to save the component.

&#x20;      ![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2Fu9yeVEcK9K0oSfqiUhjp%2F8.png?alt=media)s

* A notification message appears to inform about the component configuration saved.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2F1Guj4CNbYqLDfJNlA8aY%2F9.png?alt=media)

{% hint style="info" %}
_<mark style="color:green;">Please Note:</mark> The user should know the Kafka details and topic name._
{% endhint %}

