KSQL Configuration

Describes KSQL configuration parameters for sKSQL

Configuration Parameters

Set the following configuration parameters in the ksqlserver.properties file. See the settings for the Apache Kafka Streams API ), Apache Kafka Producer Clients and the Apache Kafka Consumer Clients for more information.
Note: The default KSQL configuration parameters are stored in $KSQL_INSTALL_DIR/etc/ksql. The default value for KSQL_INSTALL_DIR is /opt/mapr/ksql/ksql-<version>/.
Parameters Description
listeners Set this parameter to your localhost when using KSQL in non-interactive (headless) mode. Set this parameter to an actual IP address when using KSQL in interactive (distributed) mode.

Default: 8084

ksql.default.stream (Optional; but Recommended) The default stream to consume from and send the messages to. The default stream is used if the topic name does not include stream name. For example, if a message is sent to exampleTopic and this parameter is set to /exampleStream, then the message will be sent to /exampleStream:exampleTopic.

Example ksqlserver.properties file

The following sample configures KSQL in non-interactive (headless) mode:

ksql.command.topic.suffix=commands
ksql.service.id=app2
listeners=http://localhost:8084
ksql.default.stream=/sample-stream

The following sample configures KSQL in interactive (distributed) mode:

Note: The listeners parameter is set to an actual IP address.
ksql.command.topic.suffix=commands
            ksql.service.id=app2
            listeners=http://192.168.121.73:8084
            ksql.default.stream=/sample-stream

Configuring for Non-Interactive Mode

To set up KSQL in non-interactive mode, complete the following configuration tasks:

  1. Specify the KSQL configuration parameters in the ksqlserver.properties configuration file. See the settings for the Apache Kafka Streams API ), Apache Kafka Producer Clients and the Apache Kafka Consumer Clients for more information.
    Note: The default KSQL configuration parameters are stored in $KSQL_INSTALL_DIR/etc/ksql. The default value for KSQL_INSTALL_DIR is /opt/mapr/ksql/ksql-<version>/
    Parameters Description
    ksql.default.stream (Optional; but Recommended) The default stream to consume from and send the messages to. The default stream is used if the topic name does not include stream name. For example, if a message is sent to exampleTopic and this parameter is set to /exampleStream, then the message will be sent to /exampleStream:exampleTopic.
  2. Run KSQL in non-interactive mode:
    $KSQL_INSTALL_DIR/bin/ksql-server-start
    $KSQL_INSTALL_DIR/etc/ksql/ksqlserver.properties --queries-file some-queries-file.sql

Example ksqlserver.properties file

ksql.command.topic.suffix=commands
          ksql.service.id=app2
          listeners=http://localhost:8084
          ksql.default.stream=/sample-stream

For more information