Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Your company's Java services use SQS and SNS, a self-managed Kafka cluster, Amazon EventBridge and RabbitMQ, chosen team by team. Messages cross between them through custom bridges. As a principal engineer, what standard would you propose for messaging on AWS?

I would classify the messaging needs first, work queues with per-message retry, fan-out notifications, ordered replayable event streams and cross-account routing, and then pick a small default set, for example SQS with SNS for commands and simple events and Kafka on Amazon MSK for event streams, with EventBridge for cross-account routing and written criteria for exceptions. Across every broker we standardize the event envelope, schemas, naming, dead-letter handling, idempotency and tracing headers, retire the custom bridges that lose messages, and compare managed per-request cost with the people cost of self-managed clusters.

Background to this question

Messaging sprawl is what happens when every team picks the broker it knows. Each choice was reasonable on its own, but together they create four sets of client libraries, four ways to retry, custom bridges that copy messages between systems and lose some of them, and nobody who understands the whole flow during an incident. A principal engineer is expected to fix this without stopping delivery or forcing a big-bang rewrite. In this answer, we will classify what teams actually need, choose a default set with exception criteria, standardize what crosses brokers, deal with the bridges, and weigh the cost of operating each option.

1Start With the Needs, Not the Products

A standard that starts with "we use Kafka" will be resisted, because some teams have good reasons for their choice. So we start by classifying the messaging needs we see across the company. Most usage falls into four shapes.

A work queue hands tasks to workers, each task processed once with its own retry and dead-letter handling: resizing images, sending emails, processing an uploaded file. A fan-out notification tells several services that something happened, without needing history. An event stream is an ordered, replayable log that consumers can reread from any point, which is what we need for event sourcing, data pipelines and rebuilding read models. Cross-account routing moves events between AWS accounts or to SaaS targets by rules on their content.

Needs and the default choice for each
NeedDefaultWhy
Work queue, per-message retrySQSvisibility timeout, DLQ, no capacity planning
Fan-out notificationSNS to SQSone copy per consumer queue, filters
Ordered, replayable streamKafka on Amazon MSKpartition order, retention, replay
Cross-account or SaaS routingEventBridgecontent rules, account and SaaS targets
Complex routing, existing appsRabbitMQ by exceptiononly with a documented reason
A short default list, with a clear path for exceptions.

2Choosing a Small Default Set

From those needs we pick defaults, as few as possible. A typical set is SQS plus SNS for commands and simple events, because they are fully managed and cheap at moderate volume, and Kafka for event streams, preferably managed as Amazon MSK so we stop running the self-managed cluster ourselves. EventBridge covers cross-account routing and AWS service events, where its rule matching shines.

Each default comes with written criteria. A team that wants something else writes a short proposal explaining which need the defaults do not meet, and an architecture group reviews it. The criteria matter more than the list, because they turn arguments about taste into a check against needs. RabbitMQ, for example, might be allowed for an existing application that relies on its routing features and would gain nothing from moving.

3Standardizing What Crosses Every Broker

Even with fewer brokers, events will cross between them, and much of the pain comes from each team shaping messages differently. So the most valuable part of the standard is broker-independent. Every event uses one envelope: an id, a type, a source, a time, a schema version and the payload; the CloudEvents specification is a ready-made format for this. Schemas live in a registry and are checked for compatibility in CI. Names follow one convention, such as domain.entity.event-name.

Behaviour is standardized too. Every consumer has a dead-letter destination with alerts and a documented redrive procedure, and every consumer is idempotent using the envelope's id, because every broker here can redeliver. Every message carries W3C trace context headers, so a trace follows an order from the API through SNS, SQS and Kafka. A shared Java library or Spring Boot starter implements the envelope, serialization, tracing and dead-letter handling for each broker, so teams get the standard by adding a dependency rather than reading a document.

JSON
{
"id": "8b1f7c2e-1d4a-4c55-9a8e-2f6a0e9b1c3d", // used for idempotency everywhere
"type": "orders.order.placed",
"source": "order-service",
"time": "2026-11-06T10:15:30Z",
"dataschema": "orders.order.placed/v3", // checked against the registry in CI
"traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"data": { "orderId": "42", "total": 129.90 }
}

4Retiring the Custom Bridges

Custom bridges are the riskiest part of the current landscape. A bridge reads from one broker and writes to another, and doing that without loss or duplication is hard: it must commit its read position only after the write succeeds, handle the target being down, preserve ordering where it matters, and be monitored like a production service. Hand-written bridges usually do some of that, which is why they are a frequent source of lost messages.

We list every bridge, who owns it, and what flows through it. Some disappear once both sides use the default broker. Others are replaced with supported connectors, such as Kafka Connect connectors for SQS or EventBridge Pipes, which handle offsets, retries and monitoring. The ones that must remain get an owner, end-to-end message counts on both sides and an alert when they diverge.

Step throughWhat to do with each existing bridge
  1. List the bridgeowner, flow, volume
  2. Still needed after migration to defaults?
    YesContinueNoDelete it
  3. Supported connector exists?
    YesReplace with connectorNoKeep with owner
  4. Monitor both sidescounts in vs out, alert on gap

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

5Weighing Cost and Operations

Managed services cost money per request or per hour, and self-managed clusters cost people. SQS and SNS cost almost nothing at low volume but add up at billions of messages a month, where Kafka's per-byte efficiency wins. A self-managed Kafka cluster looks cheap on the invoice, but it needs upgrades, broker replacement, partition rebalancing and an on-call rotation, perhaps one to two engineers' time. MSK or a serverless option moves much of that to AWS at a higher unit price. We put both kinds of cost in the comparison, and we migrate gradually: new work uses the defaults now, existing flows move when they change for other reasons or when a bridge is retired.

6Follow-up questions

When would you allow a team to keep RabbitMQ?

When it meets a real need the defaults do not, and moving would cost more than it gives back. Examples are an application built on RabbitMQ's exchange and routing-key patterns, priority queues or request-reply over the broker, especially if it is stable and rarely changes. The team keeps it as a documented exception: it must follow the envelope, tracing and dead-letter standards, have an owner, and preferably run on a managed offering such as Amazon MQ. We revisit the exception when the application is next redesigned.

Why not standardize on Kafka for everything?

Kafka is excellent for ordered, replayable streams, but it is a poor fit for simple work queues with per-message retry: a slow or failing message blocks its partition, and retries need extra topics. It also costs more to run at low volume. Using SQS for work queues and Kafka for streams gives each need the tool that fits it.

How do you get teams to follow the standard?

By making it the easy path: a starter library that does the envelope, tracing and DLQ setup, templates in the infrastructure code, and examples. Then we add light checks, such as schema compatibility in CI and a review for new brokers, rather than relying on a document nobody reads.

7Conclusion

In this answer, we built a messaging standard from needs rather than products: SQS for work queues, SNS with SQS for fan-out, Kafka on MSK for replayable streams and EventBridge for cross-account routing, with written criteria for exceptions such as RabbitMQ. The broker-independent part, envelope, schemas, naming, dead-letter handling, idempotency and tracing, matters most, custom bridges are retired or replaced with supported connectors, and cost includes both invoices and on-call time.

What to say in the interviewAbout 90 seconds aloud

Open with

I would start by classifying what teams actually use messaging for, rather than picking a product. In practice there are four needs: work queues where each message is processed once with its own retry, fan-out notifications, ordered event streams that consumers can replay, and routing events across accounts or to SaaS targets.

Then, if they want more

Then I would propose a small default set: SQS for work queues, SNS fanning out to SQS for simple events, Kafka, ideally on Amazon MSK, for replayable streams, and EventBridge for cross-account routing. Anything else, for example RabbitMQ, needs a short proposal saying which need the defaults miss.

The more important part is what we standardize across all brokers: one event envelope with id, type, source, time and schema version, schemas in a registry with compatibility checks, a naming convention, a dead-letter destination and redrive procedure for every consumer, idempotency using the event id, and trace context headers so a trace follows a request across brokers.

A shared starter library implements this, so following the standard is the easy path. The custom bridges I would inventory and retire, or replace with supported connectors like Kafka Connect or EventBridge Pipes, because hand-written bridges are where messages get lost. Finally I would compare cost honestly: managed services charge per request, while self-managed Kafka costs engineers and on-call time. New work uses the defaults immediately, and existing flows migrate when they change.

About this answer

Last updated
12 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
AWS 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 "Your company's Java services use SQS and SNS, a self-managed Kafka cluster, Amazon...": https://scrivio-interview-library.netlify.app/spring-boot/aws/0a1076fa01/