Skip to content


KsqlRestApplication is a ksqlDB API server (that can be started using ksql-server-start shell script).

Creating Instance

KsqlRestApplication takes the following to be created:

When created, KsqlRestApplication prints out the following DEBUG message to the logs:

Creating instance of ksqlDB API server

In the end, KsqlRestApplication prints out the following DEBUG message to the logs:

ksqlDB API server instance created

KsqlRestApplication is created using buildApplication utility.


KsqlRestApplication is given a CommandRunner when created.

The CommandRunner is requested to processPriorCommands followed by starting command execution in initialize. The CommandRunner is up and running until shutdown (when it is requested to close).

The CommandRunner is used to create a HealthCheckResource when KsqlRestApplication is created.


KsqlRestApplication is given KsqlConfigurables when created.

All the given KsqlConfigurables are also given separately to create the KsqlRestApplication:

KsqlConfigurables are requested to configure (with a KsqlConfig with an application.server property assigned) in startAsync.

Building KsqlRestApplication

KsqlRestApplication buildApplication(
  KsqlRestConfig restConfig,
  MetricCollectors metricCollectors)

buildApplication is used when:

Step 1. Vert.x

buildApplication creates a Vert.x subsystem.


Vert.x allows writing reactive applications on the JVM with support for HTTP, TCP, UDP, file system, asynchronous streams. etc.

buildApplication creates an internal KsqlClient.

buildApplication creates a KsqlSchemaRegistryClientFactory and DefaultConnectClientFactory.

buildApplication determines the Kafka Cluster ID and reads the configuration property (from the KsqlConfig).

buildApplication creates a KsqlRestConfig.


buildApplication creates a KsqlEngine.


buildApplication builds the name of the command topic (to create a CommandStore and a CommandRunner).

buildApplication creates a CommandStore.

Step x. InteractiveStatementExecutor

buildApplication creates an InteractiveStatementExecutor.


buildApplication creates a QueryExecutor and a StreamedQueryResource.

Step x. CommandRunner

buildApplication creates a CommandRunner (with the InteractiveStatementExecutor).


In the end, buildApplication creates a KsqlRestApplication.


void startAsync()

startAsync prints out the following DEBUG message to the logs:

Starting the ksqlDB API server


In the end, startAsync prints out the following INFO message to the logs followed by displayWelcomeMessage.

ksqlDB API server listening on [comma-separated listeners]

startAsync is part of the Executable abstraction.


void displayWelcomeMessage()


In the end, displayWelcomeMessage prints out the following to the standard output:

Server [version] listening on [comma-separated listeners]

To access the KSQL CLI, run:
ksql [listener]


void startKsql(
  KsqlConfig ksqlConfigWithPort)



void initialize(
  KsqlConfig configWithApplicationServer)



void registerCommandTopic()


Back to top