Scrivio Interview library
LeadershipPrincipal6 min read · updated 13 November 2026

Producer reliability across 200 services varies: some block on every send, some ignore failures, some set retries=0 copied from old blog posts.

Should the platform team ship an internal producer library, enforce configuration through policy, or educate teams? What delivery guarantee should the platform promise?

I would not choose one of the three: the platform should ship thin shared defaults, such as a Spring Boot starter with safe producer settings, metrics and tracing, enforce the few settings that really matter through CI checks and topic configuration, and back both with short, incident-based education. The guarantee should be stated plainly: a record acknowledged with acks=all on a properly replicated topic is durable under stated failure assumptions, and a record the producer reports as failed is the application's responsibility, because the platform cannot promise more than the client reports.

Why this question is asked

At 200 services, producer reliability stops being a coding question and becomes an organisational one. The overview describes the usual mess: blocking sends that hurt latency, ignored failures that lose data silently, and retries=0 copied from articles written before Kafka changed its defaults. Interviewers ask this at a senior level to see how we balance control against autonomy, and whether we can state a guarantee that is true rather than reassuring. In this answer, we will look at what each option costs, define the guarantee, design the shared defaults, decide what to enforce and how, plan the education, and finish with how to tell whether it worked.

1Recap: What Is Actually Going Wrong

The three symptoms in the overview are different mistakes. Blocking on every send, by calling get() on the result inside a request, turns Kafka latency into request latency and, during an outage, into hanging threads. Ignoring failures means records that the producer reported as failed are simply gone, with nobody told. And retries=0 makes every routine leader election, which normally takes under a second, fail records that a retry would have delivered.

Notice that the client already does the right thing by default in recent versions: idempotence on, acks=all, unlimited retries bounded by a two-minute delivery timeout. Most of the damage comes from overrides and from not handling the result. That shapes the answer: the platform's job is mostly to protect good defaults and make failures visible, not to reinvent the producer.

2Weighing the Three Options

A thick internal producer library, one that wraps KafkaProducer behind our own API, gives the most control. But it hides the client from teams, so they cannot use the documentation and examples written for the real API; it lags behind client releases, so a security fix in the Kafka client waits for the platform team; and every feature a team needs becomes a request to the platform. After a few years such libraries are often the main reason a company is stuck on an old client.

Policy alone, rejecting bad configurations, catches settings but not code. A service with perfect settings that ignores the returned future still loses data. Education alone is cheap and respectful, but at 200 services and normal staff turnover it decays within a year.

What each option buys and costs
OptionGivesCosts
Thick wrapper libraryFull control over behaviourHides the client, lags releases, platform bottleneck
Policy and enforcement onlyBad settings rejectedMisses code mistakes such as ignored futures
Education onlyCheap, builds understandingDecays with turnover; nothing checks it
Thin defaults + targeted checks + educationSafe by default, visible failuresSome teams diverge; needs tracking

3Defining the Guarantee Plainly

Before choosing tools, we write down what the platform promises, because every other decision follows from it. A good statement reads: a record acknowledged to the producer with acks=all, on a topic with replication factor 3 and min.insync.replicas=2, survives the failure of any single broker or zone. A record the producer reports as failed, through the callback or the future, has not been delivered, and handling it is the application's responsibility. A record whose result the application never checks has no guarantee.

That last sentence sounds blunt, and it should. The platform cannot know about a record the client reports as failed unless the application looks, and promising 'Kafka never loses data' leads teams to skip exactly the handling that prevents loss. Stating the boundary clearly also tells teams where they need an outbox: anywhere a failed publish cannot simply be retried by the caller.

4Thin Shared Defaults

The main deliverable is a Spring Boot starter, or configuration bundles for non-Spring services, that sets safe producer defaults, adds metrics and tracing, and logs every failed send with the topic and key. It does not replace KafkaTemplate or KafkaProducer; teams still use the standard API and the standard documentation.

Keeping the shared code thin is deliberate. The starter is mostly configuration, so upgrading the Kafka client across 200 services is a version bump rather than a migration.

Properties
# what the starter applies unless a team overrides it, with a reason
spring.kafka.producer.acks=all
spring.kafka.producer.properties.enable.idempotence=true
spring.kafka.producer.properties.delivery.timeout.ms=120000
spring.kafka.producer.properties.max.block.ms=5000 # do not hang request threads for 60 s
# plus: a ProducerListener that logs and counts every failed send,
# Micrometer producer metrics, and tracing headers on every record

Notice the overrides of the client defaults are few. Lowering max.block.ms is the one most services benefit from, because a minute-long block inside a web request is rarely what anyone wants.

5Enforcing What Matters, and Teaching the Rest

Enforcement targets a short list of things that cause data loss. A CI check reads each service's configuration and fails the build on retries=0, acks=0 or acks=1 for topics marked critical, or idempotence disabled without an approved exception. On the broker side, critical topics are created through a reviewed path with replication factor 3 and min.insync.replicas=2, so a client cannot weaken durability from its side. A dashboard shows failed sends per service, so ignored failures become visible even when the code never checks them.

Education then explains the why. A one-page reliability checklist for new producers (handle the result, decide what happens on failure, never set retries=0, use an outbox when the event must not be lost) and two or three short write-ups of our own incidents work far better than a generic training course, because engineers remember the outage that hit a neighbouring team.

Step throughHow a new producer reaches production
  1. Team adds the startersafe defaults, metrics, failure logging
  2. CI configuration lintrejects retries=0, weak acks on critical topics
  3. Does the lint pass?
    YesBuild continuesNoFix, or request a reviewed exception
  4. Topic created through platform pathRF 3, min.insync.replicas=2 for critical topics
  5. Failed-send dashboard per servicealerts route to the owning team

5 steps in order. Play them, or step through them one at a time.

6Measuring Whether It Worked

We track adoption (how many services use the starter and pass the lint), the rate of failed sends per service, and the number of incidents caused by producer configuration or ignored failures, quarter by quarter. If incidents keep coming from one pattern, that pattern moves from education into enforcement. If teams keep requesting the same exception, the policy is probably wrong and should change.

Over two or three quarters, the realistic goal is that every new producer starts safe, the old risky overrides are gone from critical topics, and a failed send shows up on someone's dashboard within minutes rather than in a customer complaint weeks later.

7Follow-up questions

What about teams that genuinely need acks=1 for low latency?

They can have it on non-critical topics, through a documented exception that names the topic and the accepted risk. The point of enforcement is not to forbid trade-offs but to make sure they are deliberate and visible. Metrics and click streams often accept acks=1; payments and orders do not.

Why not provide a wrapper that retries failed sends automatically?

Because a retry inside the client after the delivery timeout has already expired can break ordering for the key, and a wrapper that retries forever in memory just moves the loss to the next crash. Durable retry belongs in the application's design, usually an outbox, and the platform can provide a reference implementation of that rather than hiding it inside the producer.

8Conclusion

In this answer, we saw that a thick wrapper, policy alone and education alone each fail in a predictable way, and that the combination works better: thin shared defaults that keep teams on the standard client, targeted enforcement of the few settings that lose data, and incident-based education. We stated the guarantee honestly: acknowledged records with acks=all on properly replicated topics are durable under stated failures, and failures the client reports are the application's to handle. Finally, we measure adoption and incidents so the policy improves over time.

What to say in the interviewAbout 80 seconds aloud

Open with

I would do all three, but in a deliberate balance, and start by writing down the guarantee. The platform promises that a record acknowledged with acks=all on a topic with replication factor three and min.insync.replicas two survives a broker or zone failure, and that a record the producer reports as failed is the application's responsibility.

Then, if they want more

We cannot promise more than the client reports, and saying Kafka never loses data makes teams skip the handling that actually prevents loss. Then I would ship a thin Spring Boot starter rather than a wrapper library: safe defaults, a lower max.block.ms, metrics, tracing, and logging plus counting of every failed send, while teams keep using KafkaTemplate directly.

Thick wrappers hide the client and lag its releases, and in a few years they become the reason you cannot upgrade. For enforcement, I would lint configuration in CI for retries=0 and weak acks on critical topics, and set durability on the topic side, so a client cannot weaken it. A dashboard of failed sends per service catches ignored futures.

Education would be a short checklist and a few of our own incident write-ups. And I would track adoption, failed sends and incidents each quarter, moving recurring problems from education into enforcement.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Apache Kafka documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Should the platform team ship an internal producer library, enforce configuration...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-clients-in-depth/2aa01919b0/