Kafka
Get started⚓︎
Hydrolix Projects and Tables can continuously ingest data from one or more Kafka - based streaming sources.
Kafka source configuration is completed using the Kafka Sources API or through the Web UI.
👍 The basic steps are:
- Create a Project/Table
- Create a Transform
- Configure the Kafka Source and Scale.
It is assumed that the project, table and transform are all already configured. More information on how to set these up can be found here - Projects & Tables, Write Transforms.
Set up a Kafka source through the API⚓︎
To create, update, or view a table's Kafka sources through the Hydrolix API, use the /sources/kafka API endpoint. Note that you will need the IDs of your target organization, project, and table in order to address that endpoint's full path.
Adding Kafka sources to a table involves /sources/kafka API endpoint, sending it a JSON document describing the connection between your Hydrolix table and the Kafka data streams.
For example, the following JSON document set up a connection between a pair of Kafka sources running at the domain example.com and the Hydrolix table my-project.my-table.
Example⚓︎
Configuration properties⚓︎
The JSON document describing a Kafka-based data source requires the following properties:
| Property | Purpose |
|---|---|
name |
A name for this data source. Must be unique within the target table's organization. |
type |
The type of ingestion. Pull only supported at this time. |
subtype |
The literal value "kafka". |
transform |
The name of the transform to apply to this ingestion. |
table |
The Hydrolix project and table to ingest into, expressed in the format "PROJECT.TABLE". |
settings |
The settings to use for this particular Kafka source. |
pool_name |
The name that Hydrolix will assign to the ingest pool. |
k8s_deployment |
Only used for Kubernetes deployments, describes the replicas, memory and CPU and service to be used in the Kafka ingest pool. "k8s_deployment":{<br> "cpu": 1,<br> "replicas": 1,<br> "service": "kafka-peer"<br> } |
The Settingsobject.⚓︎
The settings property contains a JSON object that defines the Kafka servers and topics this table should receive events from.
| Element | Description |
|---|---|
bootstrap_servers |
An array of Kafka bootstrap server addresses, in "HOST:PORT" format. |
topics |
An array of Kafka topics to import from the given servers. |
Set up a Kafka source through the UI⚓︎
To create a Kafka source, click the Add New button in the upper right of the UI and select Table Source. You will be redirected to a New Ingest Source form at https://YOUR-HYDROLIX-HOST.hydrolix.live/data/new-ingest-source/.
To manage your stack's Kafka sources through its web UI, visit an individual table at https://YOUR-HYDROLIX-HOST.hydrolix.live/data/tables/<table_id> in your web browser and select a source from the Table Sources widget.

Authenticating Kafka connections with TLS⚓︎
If your Kafka data source requires a TLS-authenticated connection, you can update your Hydrolix cluster with TLS certificate and key information.
To do this, use a Kubernetes curated secret with the following options:
| Option | Expected Value |
|---|---|
KAFKA_TLS_CA |
A TLS certificate authority file, in PEM format. |
KAFKA_TLS_CERT |
A TLS certificate file, in PEM format.| |
KAFKA_TLS_KEY |
A TLS Key file, in PEM format. |
For example:
To set the secret:
Exporting certificates and keys from Kafka's Java keystore⚓︎
By default, Kafka stores its certificate and key information into a java keystore (.jks) file. Because Hydrolix requires this information as files in PEM format, you must export this information before updating your cluster.
To do this, you must have the keytool and openssl command-line programs installed on your system. Then, complete the following steps.
Exporting your CA and certificate files⚓︎
-
List all the certificates present in your keystore:
-
Locate the CA certificate file--
caroot, in this example--and export it: -
Use
opensslto transform it into PEM format: -
Follow the same steps for your TLS certificate file--
clientcert, in this example:
Exporting your key file⚓︎
Exporting your key from the Java keystore takes a couple of additional steps.
-
Use
keytoolto create a new PKCS12 store: -
Use
opensslto extract the private key in PEM format, and usesedto remove extra information:
At this point, you should have the three PEM files you need to update your Hydrolix cluster with your Kafka TLS information.
Scaling⚓︎
To scale the Kubernetes deployment for the ingest pool used by this source, including the number of replicas, memory, and CPU, see the scaling resource pools page.
get more help⚓︎
If you need more help using Kafka with Hydrolix, or you'd just like to learn more about this integration, please contact Hydrolix support.