Configuring the Kafka Producer Adapter for a TIBCO Cloud Messaging (TCM) Kafka Service

Configuring the Kafka Producer Adapter for a TIBCO Cloud Messaging (TCM) Kafka Service

book

Article ID: KB0072500

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10.6

Description

This article provides guidance on configuring the Kafka Producer adapter for a TIBCO Cloud Messaging (TCM) Kafka service. The TCM configuration file is obtained from the TCM web ui, and is used to configure the necessary Kafka Producer adapter properties. This allows you to publish messages from a locally-run Streaming application to topics brokered by your TCM Kafka service. 

Issue/Introduction

Provides the steps needed to configure the Kafka Producer adapter to connect to a TIBCO Cloud Messaging (TCM) Kafka Service.

Resolution

In the TCM web ui, go to the ' Authentication' screen and select ' Create Role'. Provide a Role Name, and select the Kafka service. Also ensure this role is entitled to publish messages.

TCM create publish role

When you are returned to the Authentication screen, you should now see the role you created in your role list. In the ' Configuration File' column, select the option to download the role configuration file ( tcm-config.yaml). This file contains the authentication key for this role, as well as the connection details for the Kafka TCM service.

download TCM config

In Studio, open your publisher application (*.sbapp) and go to the Kafka Producer adapter Properties view. Set the 'Brokers' adapter property to the value of 'kafka_broker' shown in your tcm-config.yaml. For example:

Brokers = tib-sub-****.messaging.cloud.tibco.com:12345

In the Kafka Producer adapter Properties view under Advanced Options > Advanced Config, set the following Key/Value pairs:
 
 security.protocol = SASL_SSL sasl.mechanism = SCRAM-SHA-256 sasl.jaas.config = org.apache.kafka.common.security.scram.ScramLoginModule required username="<kafka_username>" password="<kafka_password>";

..where <kafka_username> and <kafka_password> correspond to those values specified in the tcm-config.yaml. For example..
 
 sasl.jaas.config = org.apache.kafka.common.security.scram.ScramLoginModule required username="TIB_SUB_******/channel" password="token:******";

Kafka advanced config TCDS

Your local Streaming application is now configured to publish messages to the TCM Kafka service.