---
title: Kafka TCP
slug: bhdo/kafka-tcp
createdAt: 2022-11-24T18:25:20.000Z
---

You can connect and send messages to Kafka-TCP from a Belden Horizon Data Operations device. Data is collected from the selected device. Devices on Belden Horizon Data Operations can be set for further analysis and reporting capabilities.

# Step 1: Set up the Kafka-TCP server

**To set up the Kafka-TCP server:&#x20;**

1. Connect and log in to the Kafka-TCP server.
2. From the command screen cursor, enter **cat docker-compose.yml**.
   The services list appears.&#x20;
3. From the cursor, enter **docker-compose up**.&#x20;
   The TCP\_Zookeeper and TCP\_Kafka start up.

# Step 2: Add Device

Follow the steps to [Connect a Device](https://public-docs.litmus.io/bhdo/connect-a-device). The device will be used to store tags that will be eventually used to create outbound topics in the connector. Make sure to select the **Enable Data Store** check box.&#x20;

For this use case, select the **Simulator&#x20;**&#x64;evice and **Simulator (Gen1)** driver.&#x20;

# Step 3: Add Tag

After connecting the device in Belden Horizon Data Operations, you can [Add Tags](https://public-docs.litmus.io/bhdo/add-tags) to the device. Create tags that you want to use to create outbound topics for the connector.&#x20;

For this use case, create a tag with the following details.&#x20;

- **Name**: Select **int-integer**.&#x20;
- **Value Type**: Select **int**.&#x20;
- **Tag Name**: Enter **temp**.&#x20;
- **Polling Interval**: Enter **1**.&#x20;
- **Address**: Enter **0**.&#x20;

# Step 4: Add Kafka TCP Connector

Follow the steps to [Add a Connector](https://public-docs.litmus.io/bhdo/add-a-connector) and select the **Kafka TCP&#x20;**&#x70;rovider.&#x20;

Configure the following parameters.&#x20;

- **Name**: A recognizable name to identify the connector.&#x20;
- **Brokers list separated by comma**: Enter the Kafka broker URL. For example: 192.168.56.1.&#x20;
- **SASL mechanism**: Select an option: NONE, SASL\_PLAINTEXT, SCRAM-SHA-256, SCRAM-SHA-512.&#x20;
- **Username&#x20;**(Optional)&#x20;
- **Password**: (Optional)&#x20;
- **Topic**: Enter **test\_topic**.&#x20;
- **Throttling Limit**: The maximum number of messages per second to be processed. The default value is zero, which means that there is no limit.&#x20;
- **Persistent storage**: When enabled, this will cause messages to undergo a store-and-forward procedure. Messages will be stored within Belden Horizon Data Operations when cloud providers are online. &#x20;

# Step 5: Add Topics to Kafka TCP Connector&#x20;

You will now need to import the tag you added in Step 3 to the connector as topics.&#x20;

**To import tags:**

1. Click the *Kafka TCP* connector tile.
   The connector *Dashboard&#x20;*&#x61;ppears.&#x20;
2. Click the **Topics&#x20;**&#x74;ab.&#x20;
3. Click the **Import from DeviceHub tags** icon.&#x20;
   The *DeviceHub Import&#x20;*&#x64;ialog box appears.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/1qevoUz7j1eLrU6mauBn3_import-from-devicehub.png" size="80" width="1148" height="570" caption="Import tags icon" position="center" showCaption="true"}
4. Select the appropriate device and click **Import**.
5. From the connector tile, click the toggle to disable and then enable the connector to restart it.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/5KHnV_Lj7jdhAnNpVGJdk_kafkatcp.png" size="60" width="351" height="260" caption="Toggle to enable connector" position="center" showCaption="true"}

See the *Connector Topics* section in [Manage Connectors](https://public-docs.litmus.io/bhdo/manage-connectors) for more details.&#x20;

# Step 7: Enable Topics

To enable the topics, return to the *Topics&#x20;*&#x74;ab and click the **Enable all topics** icon.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/bCV1JMfeMF7XQryi1HSGr_enable-all-topics.png" size="80" width="1148" height="570" caption="Enable all topics icon" position="center" showCaption="true"}

