
Scala Software Developer at @lensesio
London
Joined August 2008
- Tweets2.4K
- Following600
- Followers390
- Likes971
Nicolò Martini 🇪🇺🇺🇦 retweeted
Queues for Kafka is the hottest new feature being discussed right now!
"KIP-932: Queues for Kafka" was announced just 7 days ago.
But what is it?
First - let’s define a queue.
A traditional queue system is one where either:
🔹- many consumers read from the same queue (pub-sub)
🔹- one specific consumer reads from one specific producer (point to point)
The messages are typically stored until they’re consumed once - the queues have a maximum depth.
Kafka has never supported traditional queuing like this.
One of its strengths has precisely been the decoupling between producer and consumer.
A bad consumer has a close-to-zero effect on a producer. (unless it causes Kafka to read from disk and exhaust IOs)
One pain point with this approach is that consumer groups are coupled with the number of partitions in a topic.
If you have a topic with 10 partitions, you cannot scale beyond 10 consumers.
So, people usually over-partition.
But that's very unintuitive for a uniform workload. 🙅♂️
If all your messages are independent work items with no logical grouping, a single queue consumed by a pool of applications is the intuitive solution.
So, KIP-932 proposes a solution with the following benefits:
✅ - the ability for many consumers to read from the same partition
✅ - individual records acknowledgments
✅ - still keep producers and consumers decoupled
✅ - no maximum queue depth
✅ - messages are still retained - so you have the ability to replay
And the following limitations:
🔴 - Ordering is NOT guaranteed. Out-of-order delivery is possible within a partition.
🔴 - No exactly once - it is at least once.
🔴 - Maximum processing delta. A consumer cannot read more than N messages ahead of the slowest one.
How does it do it?
Shared Consumer Groups. ✨
Each broker will be a shared group coordinator for the data partitions it is leading and manage the sharing of reads.
It will keep a sliding window of start <-> end offset for each pair of partition and group.
The records available for consumption will only be those within that offset range, essentially adding a maximum lag between the slowest and fastest consumer. 🛑✋
Consumers from the same shared group can read from the same partition by exclusively reserving a few records (offset range) in the partition via a time-limited acquisition lock.
A consumer can then ack/release/reject the message(s):
🥇 ack - acknowledges successful processing and moves the shared group’s offset progress
🥈 release - unsuccessful processing - retry. Release the record for another delivery.
🥉 reject - unsuccessful processing - abort. Blacklists the record, making it unavailable for another delivery.
☠️ To avoid poison messages - a delivery count is kept per message. When it goes over a maximum retry limit, the message is rejected.
That’s it! Quite the out of the box proposal. 💡
In one sentence, this is a usability feature for un-ordered consumption by an arbitrary number of consumers.
Note that nothing here is set in stone. This proposal is still pending discussion.
I was the first person to reply to the discussion on the mailing list (humblebrag).
The proposal may look quite different by the time it gets in.
What do you think about it?
Nicolò Martini 🇪🇺🇺🇦 retweeted
Che meraviglia. Che meravigliosa meraviglia.
Putin, Trump, Bolsonaro.
Tripletta di Salvini.
[Estate 2019, festa della Lega a Cervia] nitter.cf/RassegnaTv/status/1612…
Nicolò Martini 🇪🇺🇺🇦 retweeted
Let’s zoom out and get the big picture! Some quick Neptune facts:
📍 Far out - 30x farther from the Sun than Earth
🕶️ Hello darkness my old friend - Neptune doesn’t get much Sun, so high noon would be like a dim twilight on Earth.
🥶 Ice giant. Brr.

ALT Zoomed out view of Neptune, its rings and its moons as captured by Webb. Neptune’s moon Triton, resembling a small teal snowflake, is the central focal point, with a tiny ringed, pearl-like Neptune below and to the right of it. The black background is filled with orange and white galaxies, 8-pointed bright stars and dots. A small white spiral galaxy in the bottom left corner is particularly visible.
Nicolò Martini 🇪🇺🇺🇦 retweeted
🛠🙌🏻 Reading other people's codebases is one of the most effective ways to improve your programming ability. In our new Compiler Academy video, @akmetiuk will share his methodology of understanding the Scala 3 compiler: youtu.be/09IbOMuVoog
Nicolò Martini 🇪🇺🇺🇦 retweeted
BREAKING NEWS: Today I used a piece of wood that I kept in my garage since 2006 in case I might need it. – at Delmar, NY
Nicolò Martini 🇪🇺🇺🇦 retweeted
If you want to see more breeding sessions, or see some of the weirdness with procedural crossbreeding, I made a short video about it:
youtube.com/watch?v=ohYIUxmx…
Nicolò Martini 🇪🇺🇺🇦 retweeted
Why is Kafka fast?
Kafka achieves low latency message delivery through Sequential I/O and Zero Copy Principle. The same techniques are commonly used in many other messaging/streaming platforms.
Nicolò Martini 🇪🇺🇺🇦 retweeted
Protobuf is a well-established data format often combined with gRPC.
It's great for producing & consuming messages via Kafka topics 💡
Here's how to create your first Protobuf app, send the data to #ApacheKafka, then explore it. 🔬
lenses.io/blog/2022/03/proto…
Nicolò Martini 🇪🇺🇺🇦 retweeted
1/12 We - Russia - want to be a nation of peace. Alas, few people would call us that now.
Nicolò Martini 🇪🇺🇺🇦 retweeted
My friends, a new MEGATHREAD has arrived!
In 40 tweets I’ll explain 40 useful concepts you should know.
Reading time: ~7 minutes.
Value: potentially a lifetime!
Thread:
Nicolò Martini 🇪🇺🇺🇦 retweeted
In a way, solving typechecking puzzles is satisfying and you can get good at it. But should you have to?
Nicolò Martini 🇪🇺🇺🇦 retweeted
Wrote some monad tranformers code with @shojberg the other day, and even using mtl classes (which can be dispatched a little like handlers) it was not fun compared to @unisonweb. I kept thinking "this would be trival with abilities" -
Nicolò Martini 🇪🇺🇺🇦 retweeted
A capture checking prototype for Scala has landed.
dotty.epfl.ch/docs/reference….
It's in a research branch, and still requires lots of work before it can be used in production. But it's shaping up quite well so far.
Nicolò Martini 🇪🇺🇺🇦 retweeted
"The High-order Virtual Machine is a pure functional compile target that is lazy, non-garbage-collected and massively parallel. It is also beta-optimal, [...], it can be exponentially faster than most functional runtimes, including Haskell's GHC": github.com/Kindelia/HVM
Nicolò Martini 🇪🇺🇺🇦 retweeted
The Flix programming language looks amazing flix.dev/
Nicolò Martini 🇪🇺🇺🇦 retweeted
Hot on the heals of Cats 2.7.0 is the most significant Cats Effect release since 3.0! github.com/typelevel/cats-ef… Fiber dumps, mock time, observability, tracing on ScalaJS, significant performance enhancements, and much more.
Nicolò Martini 🇪🇺🇺🇦 retweeted
Data shows us that the higher the vaccination rate, the lower the death rate.
#COVID19 #VaccinesWork
Nicolò Martini 🇪🇺🇺🇦 retweeted
float i,e,a,l,y;vec3 p,q,d=vec3((FC.xy-.5*r)/r.y,-1);for(d.xz*=rotate2D(t*.2);i++<2e2;e=max(min(++y,-e),y-3.)){i>1e2?l=log(e+=1e-4)/1e2,d/=d,o:o+=exp(-e*1e3)/2e2;p=q+=d*e*.7;p++;y=p.y;for(a=3.;a>.04;a*=.6)p.xz*=rotate2D(5.),p=abs(p)-a,e=min(e,max(p.x,(max(p.y,p.z))));}o+=l;




















