r/java • u/Apprehensive_Sky5940 • Dec 27 '25
I built a Kafka library that handles batch processing, retries, dlq routing with a custom dashboard, deserialization, Comes with OpenTelemtry support and Redis support
Hey everyone,
I am a 3rd year CS student and I have been diving deep into big data and performance optimization. I found myself replacing the same retry loops, dead letter queue managers, and circuit breakers for every single Kafka consumer I built, it got boring.
So I spent the last few months building a wrapper library to handle the heavy lifting.
It is called java-damero. The main idea is that you just annotate your listener and it handles retries, batch processing, deserialization, DLQ routing, and observability automatically.
I tried to make it technically robust under the hood:
- It supports Java 21 Virtual Threads to handle massive concurrency without blocking OS threads.
- I built a flexible deserializer that infers types from your method signature, so you can send raw JSON without headers.
- It has full OpenTelemetry tracing built in, so context propagates through all retries and DLQ hops.
- Batch processing mode that only commits offsets when the full batch works.
- I also allow you to plug in a Redis cache for distributed systems with a backoff to an in memory cache.
I benchmarked it on my laptop and it handles batches of 6000 messages with about 350ms latency. I also wired up a Redis-backed deduplication layer that fails over to local caching if Redis goes down.
Screenshots are in the /PerformanceScreenshots folder in the /src
<dependency>
<groupId>io.github.samoreilly</groupId>
<artifactId>java-damero</artifactId>
<version>1.0.4</version>
</dependency>
https://central.sonatype.com/artifact/io.github.samoreilly/java-damero/overview
I would love if you guys could give feedback. I tried to keep the API clean so you do not need messy configuration beans just to get reliability.
Thanks for reading
https://github.com/Samoreilly/java-damero
28
Upvotes
6
u/Turbulent-Board577 Dec 28 '25 edited Dec 28 '25
Thanks for sharing!
Regarding your latency graph in the README: I think it is more useful if you would share the latency numbers as percentiles, i.e. p50/p99/p999. I am curious: Why did you choose time-latency diagrams in the first place, especially as percentiles are very easy to compute?
What also caught my eye is your description of the figure with "Latency: ~350ms" and "Ultra-low latency, standard workloads".
"Latency: ~350ms": Is this the mean? Median? p99? Without this information people can hardly argue about the performance of your library.
Regarding "Ultra-low latency, standard workloads": What do you mean by that? How can it be suitable for ultra-low latency and also for standard workloads? How do you classify standard workloads? If you ask me, 350ms does not sound ULL to me, but I cannot be sure as I don't know if this is the p50 or p999.
5
u/Polixa12 Dec 28 '25
Why's everyone here so negative lol. Anyways great project bro
2
u/Tall_Letter_1898 Dec 28 '25
I am not that much into kafka, but sounds cool.
Not sure how much it applies here, but I see you mention virtual threads and supporting java 21. You might wanna try supporting java 24 as it fixes pinning issues with virtual threading.
2
u/ryan10e Dec 30 '25
Hey, just curious why the repost?
https://www.reddit.com/r/java/comments/1poyrzf/a_simple_lowconfig_kafka_helper_for_retries_dlq/
1
u/No_Telephone_5640 Mar 15 '26
Cool project, especially for a 3rd year student. DLQ routing and retry orchestration is not trivial.
Couple of things I was wondering about:
- Does the deserializer only support JSON or can it handle Avro/Protobuf too?
- For the DLQ replay, do messages go back to the original topic or to a separate retry topic?
- Also curious what you use as the Redis dedup key. Offset, business key, something else?
The Virtual Threads angle is smart for IO heavy consumers. Nice work.
0
u/aaronkand Dec 28 '25
Great work, man! Looks cool
-11
u/Cautious-Necessary61 Dec 28 '25
I have a hard time believing you. I doubt you did this by yourself, you are getting help from a senior dev who is feeding you ideas or doing it for you. Just like every kid now has 1600 SAT scores.
0
u/[deleted] Dec 28 '25
[removed] — view removed comment