Skip to content

KsqlRestClient

KsqlRestClient uses Vert.x to talk HTTP 2.0 to the ksqlDB server.

Creating Instance

KsqlRestClient takes the following to be created:

  • KsqlClient
  • Address of the ksqlDB server
  • Local properties
  • ccloudApiKey

KsqlRestClient is created using create utility.

create

KsqlRestClient create(
  String serverAddress,
  Map<String, ?> localProps,
  Map<String, String> clientProps,
  Optional<BasicCredentials> creds,
  Optional<BasicCredentials> ccloudApiKey,
  KsqlClientSupplier clientSupplier
)
KsqlRestClient create(
  String serverAddress,
  Map<String, ?> localProps,
  Map<String, String> clientProps,
  Optional<BasicCredentials> creds,
  Optional<BasicCredentials> ccloudApiKey
) // (1)!
  1. Creates a new KsqlClient using KsqlClientSupplier

create creates a KsqlClient (using the KsqlClientSupplier) to create a KsqlRestClient.


create is used when:

makeKsqlRequest

RestResponse<KsqlEntityList> makeKsqlRequest(
  String ksql) // (1)!
RestResponse<KsqlEntityList> makeKsqlRequest(
  String ksql, 
  Long commandSeqNum)
  1. Uses no commandSeqNum

makeKsqlRequest posts the ksql statement to the target.


makeKsqlRequest is used when: