r/apachekafka • • 1h ago

Tool gRPC + Kafka: A practical architecture for Java microservices (Micronaut 4 & Java 21)

2 Upvotes

Title: gRPC + Kafka: A practical architecture for Java microservices (Micronaut 4 & Java 21)

How do you decide between synchronous and asynchronous communication in a microservices architecture?

I've been exploring a combination of gRPC and Apache Kafka using Java 21 and Micronaut 4.

The idea is straightforward:

gRPC for synchronous request/response communication.

Kafka for asynchronous domain events and communication between independent services.

Protocol Buffers for strongly typed service contracts.

But combining the two introduces some interesting engineering challenges:

-Event serialization and schema evolution

-Consumer groups and idempotency

-Retry policies and dead-letter topics

-Transactional Outbox and consistency

-Observability across distributed services

I've put together a practical implementation starting with a simple Greeter service.

GitHub: https://github.com/frekost/grpc-micronaut-starter-kit

A question for the community:

How do you combine gRPC and Kafka in production?

Do you publish Kafka events directly after handling a gRPC request, or do you prefer an Outbox-based approach?

I'd love to hear about your experiences and architectural decisions.


r/apachekafka • • 1d ago

Tool Query Kafka topics with SQL from your SQL editor or terminal: KafCacheQL 0.5.0

Post image
15 Upvotes

Query Kafka data with SQL. No ksqlDB, no Flink, just a JDBC driver, a Kafka cluster and your SQL editor or a terminal.

Data pulled is cached locally in SQLite, so rerunning a query only fetches the new records.

This is a tool for platform engineers, data scientists/analysts, BI, or anyone who prefers to use SQL to interact with Kafka data without the need to write a Kafka client. All they need are credentials for a Kafka cluster (and Schema Registry, for schema-backed topics). It's also an easy way to onboard people who don't know Kafka and don't want to (or can't) spin up a sink connector.

Full disclosure, I work for Confluent, but this is a tool created for the Kafka community.

It is experimental, not recommended for production and not supposed to replace stream processing engines.

See below the full list of functionalities shipped on v0.5.0:

- One JDBC JAR: works in DBeaver, DataGrip, any Java app (Java 21+) or its own kafcacheql command line
- Kafka 3.1+: Confluent Cloud, Confluent Platform, self-managed or local
- Auth: PLAINTEXT, SSL/TLS (incl. client certificates), SASL_PLAINTEXT and SASL_SSL with PLAIN or SCRAM-SHA-256/512
- Confluent Cloud: API key over SASL_SSL, and the client.properties file Cloud generates works as-is
- Schema Registry with basic auth (API key and secret)
- Not supported (yet): OAuth/OAUTHBEARER and AWS MSK IAM
- Read-only (pull query style): it never writes to Kafka
- Topics show up as tables, and you get SQLite's SQL: joins, aggregations, JSON functions
- Compacted topics read as current state (tombstones handled), append topics as event history
- Every row has its partition, offset, timestamp, key, value and headers
- Avro, JSON Schema and Protobuf through Confluent Schema Registry, plus plain JSON, string and bytes. Schema fields become typed columns
- Schema evolution handled: columns come from every schema version in the topic, so fields added or removed over time all show up (NULL where a record doesn't have them), and if versions disagree on a field's type you get the raw value and a warning instead of a wrong conversion
- Local cache: reruns only fetch new records, and cached topics can be queried offline
- How fetching works:
  - SELECT: fetches only what the query needs that isn't cached yet. That's limited by its window if you set one, and by default it's everything Kafka still holds
  - SYNC: fetches everything new since the last cached offset, with no limit
  - Both: stop at the end offsets they saw when they started, and anything produced after that comes with the next query
- No consumer group: each consumer is assigned one partition at a time and seeks straight to the offsets it needs, by default up to 8 consumers fetching in parallel (sync.fetch.parallelism). Offsets are kept in the SQLite cache, so nothing is committed to Kafka and there's no rebalancing
- Time/offset windows on big topics, plus fast "last N records" queries
- Cache size and age limits; cached data follows Kafka's retention
- Records that fail to decode still show up as rows, with the error and the raw bytes, handy for debugging
- Drop or mask fields (PII) before anything is written to the cache, or plug in your own Java transform
- The kafcacheql command line: interactive (help, history, Ctrl-R, TAB completion) or scripted, with table, line or JSON output. Start it with just a settings file: kafcacheql ~/.kafcacheql/cloud.properties
- Your own / commands: save the queries you run every day as SQL files with typed, optional arguments in ~/.kafcacheql/commands, then run them by name, e.g. /last shop-orders 30 (every record from the last 30 minutes) or /tail shop-orders 10. help shows each command's usage and SQL, and TAB completes command and topic names. Five examples ship with the repo
- follow: like tail -f for SQL. follow /last shop-orders reruns a query or command every second (or every N seconds, e.g. follow 0.5 ...) and prints only the rows it hasn't shown yet until Ctrl-C. Works with joins, and with --mode json it streams one JSON object per row, ready for jq
- SHOW TABLES, SHOW LAG, DESCRIBE, DROP TABLE (cache only) and SYNC, with wildcards like SHOW TABLES shop-* or SYNC shop-*, easy to run from cron to keep a cache warm
- A Docker web-store demo with Zeppelin charts to try it in minutes

Repo: https://github.com/ifnesi/kafcacheql

Note: the code and docs were written with the assistance of AI, with every change tested and reviewed before release.


r/apachekafka • • 2d ago

Blog Interesting Kafka links - November 2026

Thumbnail rmoff.net
8 Upvotes

r/apachekafka • • 2d ago

Tool Kafka-Backed GraphQL Subscriptions with Spring and Atleon

0 Upvotes

This demo project shows how GraphQL subscriptions backed by Kafka can be implemented in Spring applications using natively reactive clients from Atleon. While attempting to maximize simplicity, this project accomplishes the following:

  1. Backing GraphQL subscriptions with either shared (application-wide) or dedicated/per-invocation consumer instances
  2. Initiate subscription from historical timestamp
  3. Full integration testing via native Web Sockets and interactive UI via GraphiQL

This class contains the bulk of the interesting implementation details. Check it out, and please share your feedback/thoughts!


r/apachekafka • • 3d ago

Tool (AI) I built a fault-tolerant Kafka producer/consumer in Go (franz-go): retries, DLQ, circuit breaker. Feedback welcome

5 Upvotes

I built this to learn how production Kafka clients handle failure.

What it does:

  • Idempotent producer, acks=all, zstd compression, back-pressure
  • Consumer groups (cooperative-sticky), ordered processing per partition
  • Bounded retries with backoff, then a dead-letter topic with x-error / x-attempts headers
  • Circuit breaker, /healthz /readyz /metrics, graceful shutdown
  • 3-broker KRaft cluster in Docker Compose, CI, architecture docs with diagrams

Repo: https://github.com/Ruwais-zaid/kafka-go-messaging

Where I’d love feedback:

  1. The consumer runs one goroutine per partition per poll and waits for all of them, so a slow partition blocks the next poll. Is that a reasonable trade-off?
  2. Commit strategy: mark after processing or after the DLQ write, then auto-commit marks.

Thanks!


r/apachekafka • • 4d ago

Blog Miro: From 42% to 2.5% CPU: How We Optimized Our Kafka Cluster and Cut Its Cost by 83%

Thumbnail miro.com
73 Upvotes

r/apachekafka • • 5d ago

Blog Kafka Simulator v2.3 - WarpStream, Redpanda Cloud Topics, Ursa and Nisshi

Thumbnail monedula.dev
5 Upvotes

Kafka Simulator v2.3 is out!

I've added four more diskless Kafka architectures:

• WarpStream: stateless agents and a separate control plane

• Redpanda Data Cloud Topics: offset assignment through Raft

• StreamNative Ursa: write-ahead logs compacted into Parquet files

• Solace Nisshi (formerly Tansu): stateless brokers backed by S3 or PostgreSQL

I've also added kaf-mirror from Scalytics.

The simulator now covers 8 diskless architectures and 194 interactive scenarios, with 27 added in this release. Each implementation is modeled based on its documentation or source code.


r/apachekafka • • 8d ago

Blog Kafka Backups: What to Save and How to Restore It

Thumbnail softwaremill.com
5 Upvotes

r/apachekafka • • 9d ago

Blog Kafka Simulator v2.1 + v2.2 - cluster mirroring, Schema Registry failures and diskless Kafka in preview

Thumbnail monedula.dev
16 Upvotes

Kafka Simulator v2.1 and v2.2 are out! 🚀

31 new scenarios, including:

🔹 Diskless Kafka implementations from Aiven (Inkless), AutoMQ | Low Latency Diskless Kafka® on S3 and KafScale 2.0!
🔹 Cluster mirroring with Confluent Cluster Linking, Lenses.io K2K, MirrorMaker 2, and Apache Kafka's KIP-1279
🔹 Schema Registry failures, failovers, and compatibility issues

Big thanks to all vendors and KIP-1279 contributors for their feedback, for helping catch and correct a few details! Thanks Alexander Alten, Luke Chen, Federico Valeri, Jeremy Frenay!

Reviews with several vendors are still in progress, and the next release will definitely incorporate that feedback. More to come!


r/apachekafka • • 9d ago

Tool (AI) I built an open-source tool that breaks your Kafka cluster under load and checks whether it lost any acknowledged records

Post image
1 Upvotes

You find out how a Kafka cluster handles a broker failure on the day a broker fails, unless you have already tried it.

The usual way to try it is kafka-producer-perf-test in one terminal, kubectl delete pod in another, and a Grafana board you squint at. That gives you a rough feeling. It's hard to repeat next month, hard to run in CI, and it can't answer the question I care about most: did every record the cluster acknowledged survive?

A perf tool reports throughput and latency. A chaos tool reports that the pod died. Neither one knows which records were acked. So I built Kates, which does the load, the fault and the checking together. (I'm the author. It's free, Apache 2.0.)

The idea

Treat resilience as a test with a pass/fail result. You write down the target first, for example:

  • 2,000 records/s of 1 KiB with acks=all, P99 at or under 100 ms
  • no acknowledged record lost when one broker or one zone goes down

Then you run the load, inject the failure, and compare what you measured with the target. Every run is stored in PostgreSQL, so you can compare today's cluster with last month's.

How the loss check works

The INTEGRITY test puts a sequence number, a run ID hash and a CRC32 in every record. The producer tracks which sequences the broker acknowledged. Afterwards a consumer reads everything back, and any acknowledged sequence it never saw is lost:

Acknowledged:  1 2 3 4 5 6 7 8
Read back:     1 2 3 . 5 6 . 8
Lost ranges:   [4-4], [7-7]
Lost:          2

It also checks ordering within each partition and duplicates. A send that failed and was never acked doesn't count as loss.

What else it does

  • Load: load, stress, spike, endurance, volume, capacity and round-trip tests, using real Kafka clients on virtual threads.
  • Faults: 13 types (pod kill, network partition, CPU/memory/I/O stress, DNS errors, disk fill, node drain...) through LitmusChaos or directly through the Kubernetes API. Which ones you get depends on the provider.
  • Guards: a disruption plan is refused if it would hit more brokers than you allowed or leave no broker untouched. There is a dry run.
  • CI: kates gate --min-grade B exits non-zero below that grade, and scenario files carry their own SLA gates. JUnit XML export and a GitHub Action are included.
  • Security: an A–F audit of broker configuration, with drift detection against a saved baseline.

The CLI is Go, the API is Quarkus (GraalVM native image), and it installs with signed Helm charts.

Try it

Docker Compose is enough for the load, integrity and audit parts (no Kubernetes, under 1 GB of RAM):

curl -fsSLO https://raw.githubusercontent.com/bmscomp/kates/main/docker-compose.yml
docker compose up -d --wait
docker compose exec kates kates test create --type INTEGRITY --records 50000 --wait
docker compose exec kates kates security audit
docker compose down -v

Fault injection needs Kubernetes. With about 16 GB of RAM, kates deploy builds a three-node Kind cluster with each node in its own zone, plus Strimzi, rack-aware brokers, Litmus, Prometheus and Grafana, so you can rehearse losing a zone on a laptop:

brew install kind kubectl helm bmscomp/tap/kates
kates deploy

What it doesn't do

  • Fault injection targets Strimzi-managed brokers. Load tests work against any Kafka cluster the API can reach.
  • A LOAD run is one producer and one consumer. Use STRESS for parallel producers.
  • With the default Litmus provider, fault start and end times can be off by several seconds.
  • The security "pentest" attacks nothing: it reads one broker's configuration and the ACL list.
  • Numbers from Kind on a laptop tell you about behavior. They are not capacity figures for production.
  • Please start with the lab or a staging cluster.

Links

I'd like to hear from people running Kafka on Kubernetes: how do you test broker or zone loss today, and which failure would you want to rehearse that isn't on this list?


r/apachekafka • • 9d ago

Video You need to learn Kafka RIGHT NOW!!

Thumbnail youtu.be
0 Upvotes

r/apachekafka • • 10d ago

Question Flink or KsqlDB

5 Upvotes

Hello Team,

I have a quick question since I am new to kafka. We have a requirement to put a filter within kafka topics and then send filtered messages to another kafka topic based on json field within the payload.

To achieve this what is the best option at enterprises level.

1.flink

2.ksqldb


r/apachekafka • • 12d ago

Tool Getting OpenTelemetry trace context through Debezium into Kafka headers

3 Upvotes

Hey folks, we just published a tutorial on getting OpenTelemetry trace context through Debezium into Kafka headers. Might be helpful to anyone running CDC who wants traces to survive the hop.

With CDC the service never produces the Kafka record, so whatever headers its request carried are gone by the time Debezium publishes the change. We store traceparent and baggage on the row with a trigger, then ExtractNewRecordState plus Kafka Connect's built-in HeaderFrom$Value moves them into headers, with no custom SMT or image. That works with any OpenTelemetry setup. Signadot is what we use on top so test environments can share one Postgres, connector and topic.

Hope it helps. Happy to answer any questions. Full transparency, I work for Signadot.

https://www.signadot.com/docs/tutorials/testing-debezium-cdc


r/apachekafka • • 14d ago

Tool Using Kafka as glue between services: what we had to build around it, and the broker we ended up writing

32 Upvotes

Hi Kafka community,

I'm a software engineer at Smartness (B2B travel tech SaaS).

Disclaimer:

  • If you use Kafka as a firehose, this post probably won't interest you.
  • If you use Kafka as glue between services, it might.

We were (and partially still are) Kafka users, not to manage tons of events or data, but to handle coordination and messaging between our products and microservices. So basically we used Kafka in a way it wasn't designed for, like many of us, I believe.

During the last year we built a new message queue (QueenMQ). At first it was a tiny one, only to solve head-of-line blocking in Kafka for our slow pipelines. Over the year it evolved into a distributed transactional message broker. I like to call it the ACID message broker.

Why am I here? Because using it instead of Kafka totally changed how we develop applications: we can offload to it things we would otherwise have to build into every application. It's built to make our lives easier, and every feature it has is one we use in production. It now powers 5/6 of our products.

It's a bit of a paradigm shift, and it covers a lot, so I made a map to help people quickly understand what I mean: https://queenmq.com/map/

Main pillars:

  • Almost infinite (tested between 10 and 10 million) dynamic, named partitions (like 'order-123')
  • Transactions that span queues, partitions, the embedded KV and timers
  • ACK and NACK, with retries, as a proper message queue
  • The features you usually need to build connected systems: DLQ, conflation, routing
  • Tested with our own Jepsen test suite

All of this runs on a super simple HTTP protocol (curl is a valid client). It's also compatible with Kafka clients, although with limited features: we added this because we wanted to switch our small, simple services to the new broker without rewriting them.

Clients are dumb, and the broker is etcd-shaped: one Raft group per tenant. That allows things like one ordered stream across every queue of a tenant (read: super simple stream joins). The price, obviously, is the ceiling: the system doesn't scale by adding more than 3 or 5 nodes. But we tested it up to 3M msg/s with decent latency (around 15-25 ms e2e p99, fsync to two of three disks), so that ceiling will never be a bottleneck for us (on the same machines, Kafka made 8M msg/s at around 10ms e2e p99, no fsync).

Inside our company it was also hard to make people understand why to use this instead of Kafka, so I'd really like feedback from the Kafka community.

Our goal is to bring the project to CNCF one day, so honest criticism helps more than anything.

Repo is here: https://github.com/queen-mq/queen

EDIT: Thanks everyone for the answers and the challenges. My biggest takeaway: QueenMQ needs a schema registry. Three people brought it up, from three very different setups.


r/apachekafka • • 14d ago

Blog Wrote up my thoughts on Current San Francisco

Thumbnail aiven.io
7 Upvotes

I had a great time with the team at Aiven at Current earlier this month, I wrote up this blog comparing it to last years events and exploring the highlights from this year.


r/apachekafka • • 15d ago

Video KafkIO Video Tutorials (finally!)

9 Upvotes

KafkIO now has a series of short, narrated video tutorials. Each video covers one task, so it's easy to go straight to the one you need.

The series is aimed mainly at Kafka or KafkIO beginners or "occasional" Kafka users, such as software engineers who may need to dive further into Kafka concepts.

What's covered:

  • Connecting: plaintext, SSL/mTLS and SASL clusters, Schema Registry, Kafka Connect and ksqlDB, plus troubleshooting
  • Messages: searching by text, date or offset; viewing and comparing messages; live streaming; producing single and bulk test messages; reading Avro, Protobuf and JSON Schema; exporting to a file
  • Topics: creating topics with custom settings; partitions, replication and lag; changing and clearing configs; deleting topics
  • Consumers, Schemas & ACLs: consumer groups, lag and offset resets; browsing and evolving Schema Registry schemas; viewing, creating and deleting ACLs
  • Kafka Connect & ksqlDB: creating, monitoring and fixing connectors; running KSQL queries; managing streams, tables and queries
  • Tools & Settings: converting PEM/P12 certificates to JKS; Kafka, Schema Registry and Connect timeouts; Kerberos (GSSAPI); proxies and trusted certificates

Videos: https://www.kafkio.com/videos
Or, via YouTube playlist: https://youtube.com/playlist?list=PLVtwgolkXSQisb9ukxb_LMilGuP_JbIBK

Hope these videos helps someone!


r/apachekafka • • 16d ago

Tool (AI) kafka-console: open-source web UI for Kafka in a single binary

Post image
29 Upvotes

I built a web console for Kafka and use it at work for debugging and ops. It's a single Go binary (franz-go) with the UI embedded. Point it at one or more clusters in a YAML file and run it, or use the Docker image.

https://github.com/rakunlabs/kafka-console

Things I use it for most:

  • Multiple kafka cluster connection
  • Finding a message: search and JavaScript filters over an offset or time range, with Avro/Protobuf/JSON Schema decoding (Protobuf also works from local .proto files, no registry needed)
  • Consumer group lag per partition, and resetting offsets with a preview of the exact offsets before applying
  • Replaying a range of messages to another topic, editing a message and resending it, importing JSON/CSV files
  • Creating or editing consumer group-id

There's also an optional MCP endpoint (read-only by default) if you use coding agents. Login is left to a reverse proxy; writes go to an audit log with the user header.


r/apachekafka • • 16d ago

Tool (AI) In Flight: an open-source console that shows what's stuck in your dead-letter queues as orders, customers and money

4 Upvotes

I am building this tool (ProvenMap's open-source project, Apache-2.0), and most of the code was written with Claude Code.

When a consumer fails, its events go to a dead-letter queue, and the dashboards show lag and offsets. Whoever owns the flow wants to know which orders are stuck, for which customers, worth how much. "In Flight" is for that person where "to learn Kafka first" is not required.

You point it at a cluster and it finds the flow's topics, consumer groups and dead-letter queues (by name, or by Kafka Connect's or Spring's headers on the records). It drafts a catalog from the records: which field is the amount and whether it's in cents, which is the order and which the customer. confirm it, and from then on it shows money at risk per consumer group and per customer, grouped by error.

All these can be configured through built-in mcp server

Welcome any comments.

Code: https://github.com/provenmap/in-flight

Its architecture as a board: https://provenmap.com/boards/paws/in-flight-the-money-moving-through-your-kafka


r/apachekafka • • 17d ago

Event Redpanda archived its GitHub repo

Thumbnail github.com
82 Upvotes

r/apachekafka • • 17d ago

Blog Change Data Capture (CDC) Explained: Stop Dual Writes with Debezium + Kafka

Thumbnail youtube.com
3 Upvotes

r/apachekafka • • 18d ago

Question What are you using as a desktop Kafka client now that Conduktor Desktop is gone?

8 Upvotes

Since Conduktor Desktop was discontinued, the options for just poking at topics locally seem kind of thin: Offset Explorer works but feels dated, Kafbat/kafka-ui is solid but I don't want to spin up a container just to peek at a topic, and kcat is great until you need Avro/Protobuf decoding.

Curious what everyone ended up with:

- What do you use day to day to inspect topics and messages?

- What's the most annoying part — Schema Registry decoding, searching/filtering messages, consumer lag, auth (SASL/IAM/mTLS), or being scared of touching prod?

- Would a lightweight native desktop app (read-only by default, Schema Registry-aware) be something you'd actually install, or are CLI + web UI good enough?


r/apachekafka • • 19d ago

Tool Building an experimental Go stream processor: what recovery failure would you test first?

2 Upvotes

A question about the project got straight to the difficult part: after a crash, where does the state come from?

kstream-go is an independent Go stream-processing core using Kafka Streams as a semantic reference.

The recovery design uses committed Kafka changelogs as the durable authority. The experimental Kafka adapters commit state changes, output, and input positions together. Recovery replays committed changes into task-owned stores.

An optional Pebble adapter provides persistent local caches. Validated local checkpoint reuse is still unimplemented. A local store surviving a restart does not, by itself, prove that it matches the committed Kafka state.

Other remaining gaps include broader consumer-group fault-tolerance qualification and heterogeneous repartition scheduling. Differential tests cover implemented scenarios against Kafka Streams 3.9.1; they do not establish full compatibility or production readiness.

Repo, examples, and validation boundaries: https://github.com/SoraDaibu/kstream-go

For people operating stateful Kafka applications: which failure would you test first before trusting this recovery design?

  • An ambiguous transaction outcome
  • Ownership loss during processing
  • A local cache-apply failure after the Kafka commit
  • Something else we’re overlooking

Concrete failure sequences or lessons from operating similar systems would be especially helpful.


r/apachekafka • • 22d ago

Tool (AI) 📣 Announcing kafuck: Apache Kafka, rewritten in Brainfuck. Blazingly fast. Memory safe. Diskless.

Thumbnail github.com
142 Upvotes

r/apachekafka • • 22d ago

Event We're hosting a webinar around consumer group latency and kafka troubleshooting

Post image
2 Upvotes

Hi chums!

We're hosting a webinar around kafka troubleshooting live next week on November 18.

We'll be debugging a cluster live and talking through the issues that can occur when you get far more messages than expected!

Disclose : we're from lenses!

sign in here