Create a connection to Apache Kafka

This quickstart shows you how to create an Apache Kafka connection.

Connecting to Apache Kafka in the Raw Zone

To consume data from your cluster you must first create a connection to Apache Kafka. This connection enables you to configure the AWS IAM credentials, bucket names, and prefixes that Upsolver needs to access the data. You can create a connection using familiar SQL syntax.

Here's the code to create an Apache Kafka connection:

// Syntax
CREATE KAFKA CONNECTION <KAFKA_CONNECTION_NAME>
      HOSTS = ('<bootstrap_server_1>:<port_number>','<bootstrap_server_2>:<port_number>') 
      CONSUMER_PROPERTIES = '<bootstrap_server_1>:<port_number> 
      security.protocol=SASL_SSL
      sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule   required username="<kafka_username>"   password="<kafka_password>";
      ssl.endpoint.identification.algorithm=https
      sasl.mechanism=PLAIN';

// Example
CREATE KAFKA CONNECTION my_kafka_connection
       HOSTS = ('pkc-2396y.us-east-1.aws.confluent.cloud:9092')
       CONSUMER_PROPERTIES = 
         'bootstrap.servers=pkc-2396y.us-east-1.aws.confluent.cloud:9092
         security.protocol=SASL_SSL
         sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule   required username="XXXXXXXX"   password="-----------";
         ssl.endpoint.identification.algorithm=https
         sasl.mechanism=PLAIN';

Last updated