Scrivio Interview library

RabbitMQ, AMQP and JMS

18 questions in 5 subtopics.

Exchanges, queues and bindings

ConceptFoundations5 min read
Explain the direct, topic, fanout and headers exchange types in RabbitMQ. An order service publishes with routing key "order.created.eu"; which binding patterns on a topic exchange would match it?
CodingFoundations6 min read
In Spring AMQP with Spring Boot, how do you declare a durable queue "invoices", a topic exchange "billing" and a binding for routing key "invoice.#", and when are they actually created on the broker?
DesignIntermediate6 min read
Design the RabbitMQ topology for a notification system where email, SMS and push services each need every "user.notified" event, the email service runs 5 instances that must share the work, and an audit service needs only EU events.
LeadershipPrincipal6 min read
Your company operates messaging in three regions with self-hosted RabbitMQ clusters, each managed slightly differently. Leadership asks for a messaging strategy for the next five years covering hosting, regional design and ownership. How would you approach it?

Acknowledgements

ConceptFoundations6 min read
What are publisher confirms and returned messages in RabbitMQ, and why does a producer need both to know a message was routed and stored?
DebuggingFoundations6 min read
A @RabbitListener throws an exception for one malformed message and the service's CPU goes to 100 percent while the same message is logged as failing thousands of times per second. Explain why and how to fix it.
ScenarioIntermediate6 min read
A RabbitMQ consumer with prefetch 250 processes slow jobs. When one pod is restarted, hundreds of messages it had prefetched are redelivered, some long after other pods were idle. How would you tune this?
LeadershipPrincipal6 min read
A regulator asks your company to demonstrate that no payment instruction can be lost or applied twice as it passes through your messaging systems. How would you build the assurance programme?

Dead-letter queues

ConceptFoundations6 min read
How does dead-lettering work in RabbitMQ, and which events cause a message to be dead-lettered?
DesignIntermediate7 min read
Implement delayed retries with RabbitMQ for an order consumer: retry after 10 seconds, then 1 minute, then 10 minutes, then park the message. Describe a design with plain RabbitMQ features and the trade-offs against in-process retries.
ScenarioAdvanced7 min read
Your RabbitMQ estate still uses classic mirrored queues, and RabbitMQ 4.0 removed classic queue mirroring. Forty services depend on these queues, many with dead-letter settings. How would you plan the move to quorum queues before upgrading?

JMS

ConceptFoundations6 min read
Compare JMS queues and topics, and explain durable and shared subscriptions in Jakarta Messaging. How does Spring's @JmsListener consume them?
DebuggingFoundations6 min read
A service sends messages with JmsTemplate in a loop and throughput is very poor; the broker shows a new connection and session for each message. What is wrong?
ScenarioIntermediate7 min read
A JMS listener processes a message, updates a database, and must not lose or double-apply the message if the service crashes in between. What are your options with sessionTransacted, JTA, and idempotency?
DesignAdvanced7 min read
Many legacy Java applications in your company use JMS with a commercial broker on premises. The company is moving to the cloud. What options would you evaluate for these applications, and how would you sequence the work?

Kafka vs RabbitMQ

ConceptIntermediate6 min read
For each of these needs, would you choose Kafka or RabbitMQ and why: (1) task queue for image processing with per-message retries, (2) event history that new services can replay, (3) routing to many queues by flexible patterns, (4) 500,000 events per second of clickstream?
LeadershipAdvanced5 min read
Your organisation runs both Kafka and RabbitMQ, each operated by a different team, and leadership wants to standardise on one. How would you approach this decision?
LeadershipPrincipal6 min read
Looking back on a decade of message brokers in your company (JMS, then RabbitMQ, then Kafka), what lessons would you apply to the next messaging decision, and how would you reduce the cost of the next migration?