Kafka Producer adapter error: Type of object '(command string)' doesn't conform with StreamBase type

Kafka Producer adapter error: Type of object '(command string)' doesn't conform with StreamBase type

book

Article ID: KB0071509

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10.6 and later

Description

After sending a 'connect' command to the Kafka Producer adapter's Command input port, an error is seen:
 

 2023-04-14 09:13:21.464000-0400 [19664:Thread- ThreadPool - 3] ERROR OutputAdapter:  Action: Command Object: (tupleid=0,command="connect") Message: Error processing command tuple:  Type of object '(command string)' doesn't conform with StreamBase type  '(command string, brokers list((host string, port int)))'

This error indicates that the adapter's Command input port's schema does not include the 'brokers' field, as noted in the Help under Home > Adapters Guide > StreamBase Embedded Adapters > Kafka Producer Adapter > (sub-heading) Command Input Port.

Resolution

Although the documentation indicates that the 'brokers' field is optional, it should be added to avoid the above error. You may refer to the 'KafkaProducerCommandSchema' from the Kafka adapters sample. The full schema should be:

Kafka Producer Command Input port schema

This sample may be loaded into Studio by going to File > Import Samples and Community Content > (search) kafka.

Issue/Introduction

Describes an error that may be seen if the Kafka adapter Command input port's schema does not include the 'brokers' field.