kafka-viewer
kafka-viewer is a lightweight local Streamlit UI for reading Kafka messages for inspection. Kafka connection details come from a local properties file. Consumer offsets are not committed or modified.
Installation
pip install kafka-viewer
Run
--config is mandatory.
kafka-viewer --config /path/to/kafka-viewer.properties
PowerShell:
kafka-viewer --config C:\path\to\kafka-viewer.properties
Configuration model
kafka-viewer uses one canonical naming convention:
- Kafka connection and consumer properties:
kafka.* - Schema Registry properties:
schema.registry.*
The parser also accepts selected Java/Spring-style aliases for compatibility (for example bootstrap.servers, ssl.truststore.location, spring.kafka.properties.*), then normalizes them into the canonical kafka.* format internally.
Configuration flow:
- Parse
.properties - Normalize aliases to
kafka.* - Validate security/SSL/SASL requirements
- Translate only supported settings into
kafka-pythonconsumer config - Report unsupported Kafka-related properties as warnings
Unknown properties are never blindly passed through to KafkaConsumer.
Supported Kafka security and connection capabilities
Supported protocols:
PLAINTEXTSSLSASL_PLAINTEXTSASL_SSL
Supported SASL mechanisms:
PLAINSCRAM-SHA-256SCRAM-SHA-512GSSAPIOAUTHBEARER
SASL credentials can be provided with either:
kafka.sasl.username+kafka.sasl.passwordkafka.sasl.jaas.config(username/password are extracted for PLAIN/SCRAM)
SSL, truststore, and keystore support
kafka-viewer supports both direct PEM paths and Java enterprise store formats.
Truststore properties:
kafka.ssl.truststore.locationkafka.ssl.truststore.type(PEM,JKS,PKCS12/PFX; optional, inferred from extension if omitted)kafka.ssl.truststore.password(used for JKS/PKCS12)kafka.ssl.truststore.cert.alias(optional JKS alias)
Keystore properties:
kafka.ssl.keystore.locationkafka.ssl.keystore.type(PEM,JKS,PKCS12/PFX; optional, inferred from extension if omitted)kafka.ssl.keystore.password(used for JKS/PKCS12)kafka.ssl.key.password(private key password or fallback decryption password)kafka.ssl.keystore.key.alias(optional JKS key alias)kafka.ssl.keystore.key.location(optional separate PEM key path)
Additional SSL properties:
kafka.ssl.endpoint.identification.algorithm(httpsornone/empty)kafka.ssl.check.hostnamekafka.ssl.protocolkafka.ssl.cipher.suiteskafka.ssl.cafilekafka.ssl.certfilekafka.ssl.keyfilekafka.ssl.passwordkafka.ssl.crlfile
For JKS/PKCS12 stores, kafka-viewer securely converts certificate and key material into short-lived local files for kafka-python. JKS conversion uses the Java keytool executable (must be available on PATH). Passwords and private key contents are never printed.
Configuration examples
Unsecured Kafka:
kafka.bootstrap.servers=localhost:9092
kafka.security.protocol=PLAINTEXT
SSL with truststore and PKCS12 keystore:
kafka.bootstrap.servers=localhost:9093
kafka.security.protocol=SSL
kafka.ssl.truststore.location=/path/to/truststore.jks
kafka.ssl.truststore.type=JKS
kafka.ssl.truststore.password=YOUR_TRUSTSTORE_PASSWORD
kafka.ssl.keystore.location=/path/to/client.p12
kafka.ssl.keystore.type=PKCS12
kafka.ssl.keystore.password=YOUR_KEYSTORE_PASSWORD
kafka.ssl.key.password=YOUR_KEY_PASSWORD
kafka.ssl.endpoint.identification.algorithm=https
SASL_SSL with PLAIN:
kafka.bootstrap.servers=localhost:9093
kafka.security.protocol=SASL_SSL
kafka.sasl.mechanism=PLAIN
kafka.sasl.username=YOUR_USERNAME
kafka.sasl.password=YOUR_PASSWORD
kafka.ssl.truststore.location=/path/to/ca.pem
kafka.ssl.truststore.type=PEM
SASL_SSL with JAAS-style credentials:
kafka.bootstrap.servers=localhost:9093
kafka.security.protocol=SASL_SSL
kafka.sasl.mechanism=SCRAM-SHA-512
kafka.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="YOUR_USERNAME" password="YOUR_PASSWORD";
Schema Registry / Confluent Avro
Schema Registry support is optional.
- If
schema.registry.urlis missing, kafka-viewer uses raw/string/JSON value display behavior. - If configured, kafka-viewer attempts Confluent Avro deserialization.
- Schema Registry config stays separate from Kafka consumer config and is never passed to
KafkaConsumer. - Authentication is optional. HTTPS does not require Basic Authentication unless it is explicitly configured.
- Certificate verification defaults to enabled for Schema Registry.
Supported Schema Registry properties:
schema.registry.urlschema.registry.basic.auth.user.info(optional)schema.registry.ssl.ca.location(optional custom CA file)schema.registry.ssl.verify=true|false(default: true)schema.registry.ssl.no.revoke=true|false(accepted for compatibility; current Python/Confluent stack does not expose equivalent revocation control, sotrueis rejected explicitly)schema.registry.ssl.certificate.location(optional client certificate)schema.registry.ssl.key.location(optional client private key)schema.registry.ssl.key.password(optional client key password)
Schema Registry TLS examples:
schema.registry.url=https://schema-registry.company.com:8082
# Optional - trust an internal/private CA
schema.registry.ssl.ca.location=/path/to/company-ca.pem
# Optional - defaults to true
schema.registry.ssl.verify=true
# Optional - compatibility only; current Python/Confluent stack does not support equivalent revocation control
schema.registry.ssl.no.revoke=false
# Optional - Basic Authentication
schema.registry.basic.auth.user.info=username:password
For HTTP Schema Registry endpoints:
schema.registry.url=http://schema-registry.company.com:8081
When schema.registry.ssl.verify is set to false, kafka-viewer explicitly disables TLS certificate verification for the Schema Registry client only. This is equivalent to an intentional curl -k scenario and does not change Kafka broker TLS behavior.
When using a custom CA, the file path is validated before the Schema Registry client is created and the file contents are never logged.
Confluent Avro deserialization uses the Schema ID embedded in the Confluent wire format and then looks that schema up via the configured Schema Registry. If deserialization fails, kafka-viewer retains the raw message safely, continues processing, and displays a sanitized error instead of crashing the app.
UI consumer group generation
The UI supports:
- Manual consumer group entry
- Optional prefix input (
Group ID Prefix) Generate Temporary Group ID
If the prefix is empty, existing generation behavior is unchanged. If a prefix is set, the generated value is prefix + generated-id.
Offset behavior
kafka-viewer is intended for inspection. It does not commit consumer offsets or modify existing consumer-group progress.
Safety guidance
Keep real .properties files containing credentials out of source control. Use kafka-viewer.properties.example as a template only.
Limitations
This release provides broad practical connection/security compatibility for Kafka/Java/Spring-style deployment concepts, but not full parity with every Java client property.
Not supported:
- Protobuf deserialization
- Publishing messages
- Topic or consumer-group administration
- Arbitrary non-Kafka Java library properties
Development
python -m pytest
python -m build
Release files for kafka-viewer 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kafka_viewer-0.3.1.tar.gz | 22.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kafka_viewer-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.3 kB
Release files / kafka_viewer-0.3.1.tar.gz
| Download URL | kafka_viewer-0.3.1.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09cf33e7340c76e563987c379c49c2c939fabe061ef13dd9d3e38127fddf7cb8
|
|
BLAKE2b-256 checksum How to use checksums |
bedf940f665b499d6c3ef0890f0c2b31af1d49c420cc8fb13ac7d02e9171ff5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / kafka_viewer-0.3.1-py3-none-any.whl
| Download URL | kafka_viewer-0.3.1-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c21db2c77d1a1aaa59e83bb5ec3903b966951e7e957cefa45477f2c9f0783cf7
|
|
BLAKE2b-256 checksum How to use checksums |
0275e98071a74ab29bbe27c478a7a96dc7c498013abe06a3b492a44b6d866775
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log