Help › Connect to databases
Connect to Apache Kafka
Connect to an Apache Kafka cluster with bootstrap servers, SASL and TLS, through any route, and what Querlyn shows of a cluster.
Querlyn 0.1.0 is not released yet. This help describes it ahead of release.
Querlyn talks to Apache Kafka with Kafka's own protocol, through the same routes as any other database: directly, through SSH or AWS Systems Manager. A Kafka connection is a cluster: the sidebar lists its topics and consumer groups, a topic opens in a topic tab where you read its messages, and a group opens in a tab with its lag; see Read messages from a topic. A query tab takes Kafka commands (consume, produce, describe) instead of SQL; see Use Kafka commands in a query tab.
What you need
- Apache Kafka 2.1 or later, with ZooKeeper or KRaft, up to Kafka 4. Changing a topic's settings needs Kafka 2.3 or later. Servers that speak Kafka's protocol, such as Redpanda, may work; Querlyn names them by the Kafka release whose requests they answer.
- The address of one broker (a bootstrap server). Querlyn asks it for the cluster's brokers and then talks to each broker itself, at the address the cluster advertises for it.
- A user and password when the cluster asks for SASL sign-in.
Fill in the dialog
- Choose and, under Database engine, Apache Kafka.
- Bootstrap server and Port (9092) name one broker. Other
bootstrap servers names more, tried in order when the first does not
answer, such as
kafka-2.example.com:9092, kafka-3.example.com:9092. - Under SASL, choose how the user signs in: None, PLAIN, SCRAM-SHA-256 or SCRAM-SHA-512. Confluent Cloud uses PLAIN with an API key as the user and its secret as the password.
- Fill in User and choose where the password is kept; see Choose where passwords are kept.
- Optionally, Client certificate: a PEM file holding a certificate and its private key, not encrypted, for clusters that require client certificates (mutual TLS). Querlyn reads it at each connect and keeps only its path.
- Under TLS, choose as for any database; see Encrypt a connection. PLAIN sends the password as it is, so use it over TLS.
- Choose Test Connection, then Save & Connect. The test reaches every broker the cluster names, through the connection's route, and names the cluster's ID, its brokers, its controller, the Kafka release and the TLS and SASL in use.
There is no database field: a cluster has none.
Reach brokers through a route
Every broker is reached through the connection's route, at the host name
and port the cluster advertises for it. Through SSH, the last hop looks up
that name, so brokers advertised with names that only resolve inside
their network (kafka-1.internal:9092) work as they are. Through AWS
Systems Manager, the instance does. When the test cannot reach a broker,
it names the broker, the address it advertises and the route.
Sign in to Amazon MSK with AWS IAM
For an Amazon MSK cluster with IAM access control, choose AWS IAM
under Authentication instead of a password. Querlyn signs each
broker's sign-in with your AWS credentials (AWS_MSK_IAM), found as the
AWS command-line tools find them; see
Sign in with AWS, Entra ID, Google Cloud or OIDC. Then:
- Use the cluster's IAM bootstrap servers: port 9098, or 9198 for public access, with TLS set to Verify full (IAM sign-in is only sent over TLS).
- Leave User empty: your AWS identity is the user. Your IAM user or
role needs a policy that allows
kafka-cluster:Connecton the cluster, and the reading and writing actions for what you do with it. - AWS region may stay empty: the brokers' names say it.
SASL is not shown with AWS IAM: the sign-in is IAM's own.
When brokers advertise addresses you cannot reach
A cluster in Docker on another machine, or in Kubernetes reached through
port forwards, often advertises addresses that mean nothing outside it,
such as kafka-1:9092 or localhost:9092. For such a cluster, fill in
Broker address map: for each advertised address, the address that
does reach that broker, written advertised=reachable and separated by
commas:
kafka-1.internal:9092=localhost:19092, kafka-2.internal:9092=localhost:19093
Querlyn then connects to each address in the map at its reachable address, through the connection's route, and to every other broker as it is advertised. Both sides need a port, and an address can be listed only once. TLS still checks the advertised name, the one the broker's certificate is for. Test Connection lists each broker reached through the map, and any entry that names no broker of the cluster (a typing mistake is not silent).
When a broker cannot be reached, the message names its advertised address and offers Add to Broker Address Map: in the connection dialog, after a test, it adds the advertised address to the map for you to complete with the reachable one; in a topic tab, it opens the connection's settings at the map. When the broker is in the map already, Edit Broker Address Map opens it to check the entry.
A Kubernetes route forwards to one pod, so it works only for a cluster of one broker: a larger cluster is refused when it connects. Use an SSH route or AWS Systems Manager to a machine that reaches every broker instead. See SSH tunnels and bastions and Kubernetes and AWS Systems Manager tunnels.
Read Avro with a Schema Registry
When producers write Avro through a Confluent Schema Registry, fill in:
- Schema Registry URL: the registry's address, such as
https://psrc-12345.us-east-2.aws.confluent.cloudorhttp://schema-registry.internal:8081. A registry that serves the Confluent API under a path, such as Apicurio'shttp://registry:8080/apis/ccompat/v7, works too. - Schema Registry user and Schema Registry secret, when the registry asks for them: on Confluent Cloud, the registry's own API key and secret (not the cluster's). The secret is kept in your system's secret store, never in the connection's settings; once saved, its field stays empty and says it is saved, and typing a new one replaces it.
The registry is reached through the connection's route, like the
brokers. An https:// address is always verified, against the
connection's CA file when it has one, else the system's trusted
certificates. Each schema is asked for once per session. See
Read messages from a topic
for what is shown.
What the sidebar shows
- Topics, with their number of partitions. Internal topics, such as
__consumer_offsets, are listed last and marked internal. Expand a topic for its partitions: each with its leader, its messages, its replicas and those in sync, and its first and next offsets. A partition without a leader, with an offline replica or with a replica out of sync is marked with a warning. - Consumer Groups, with their lag, state and members.
- Double-click a topic to read its messages, or a group to see its lag. Right-click either for what you can do with it, and the connection for .
What is particular to Kafka
- Reading never joins a group. Querlyn reads partitions directly and commits nothing, so reading a topic does not move any group's offsets.
- Messages cannot be changed. A topic is a log: produce a new message instead; see Produce a message.
- Read-only is Querlyn's check. A read-only connection refuses to produce messages and to change topics and groups. Kafka's ACLs are the stronger guard.
- Confirmations ask before deleting a topic or its records, resetting a group's offsets, deleting a group and lowering how long a topic keeps messages; see Manage topics.
- Every request is in the statement console, by name and without message contents or passwords; see See what Querlyn sends.
What Querlyn does not do
- Decode Protobuf values written for a Schema Registry (they stay bytes), or encode values for a registry when producing.
- Sign in with OAuth (OAUTHBEARER) or Kerberos.
- Produce with idempotence or in transactions.
- Show or change ACLs, quotas or the brokers' own settings.
- Kafka Connect, ksqlDB and Kafka Streams.
Help for Querlyn 0.1.0. All help topics