Skip to content

Databases

Apache Kafka Message Queue Management in VS Code

Apache Kafka is a distributed event streaming platform capable of handling trillions of events a day. Key characteristics include:

  • High-throughput messaging: Process millions of events per second with low latency
  • Durability and reliability: Persistent message storage with configurable replication
  • Horizontal scalability: Scale across brokers and partitions
  • Stream processing: Built-in support for real-time stream processing
  • Ordering guarantees: Per-partition message ordering

Kafka is ideal for event-driven architectures, data pipelines, log aggregation, and real-time analytics.

To connect to Apache Kafka in DBCode:

  1. Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
  2. Add a New Connection: Click on the “Add Connection” icon.
  3. Complete connection form: Select Apache Kafka as the database type and enter:
    • Bootstrap broker host and port (default: 9092)
    • Authentication method (No Auth, SASL/PLAIN, SCRAM-SHA-256, SCRAM-SHA-512)
    • TLS configuration, including CA trust and a client certificate/key if required
  4. Connect: Click save to connect to your Kafka cluster.
  5. Start Browsing: Navigate topics, view messages, and monitor consumer groups.

For detailed instructions, refer to the Connect article.

DBCode enhances your Kafka development experience with:

  • Topic browsing: Navigate topics with an approximate retained-offset span and expand for column details. This is not an exact message count
  • Message inspection: View messages with automatic JSON field expansion into columns
  • Consumer group monitoring: View group IDs and reported protocol types
  • Message producing: Insert messages via the standard DBCode grid interface
  • Topic management: Create and drop topics directly from the explorer
  • Live Streaming: Subscribe to a topic to consume messages in real time. Right-click a topic and select Subscribe to open a streaming data grid that displays new messages as they arrive

Opening a topic from the explorer shows its newest messages (the tail) across all partitions. Compressed topics are supported (gzip, Snappy, LZ4, and ZSTD). Kafka is command-based, not SQL: from a file or notebook connected to a Kafka connection you can run commands. TOPICS and LIST are equivalent commands that list all topics:

TOPICS
LIST

Commands other than TOPICS and LIST, including SQL, return an error rather than running. SQL execution plans, updating or deleting individual messages, and SQL-session monitoring do not apply to Kafka connections.

For more information about Kafka, visit kafka.apache.org.