RabbitMQ in Microservices — Concept Check
Questions on RabbitMQ in Microservices. RabbitMQ decouples microservices for asynchronous workflows, saga choreography, event notification, and integration events; use separate exchanges per service to avoid coupling.
Questions in this quiz
8 questions on RabbitMQ in Microservices — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer wants to ensure that their microservice can independently manage its event publishing. Which RabbitMQ pattern should they use?
- AExchange-Per-Service Pattern
- BDirect Exchange Pattern
- CSaga Orchestration Pattern
- DFanout Exchange Pattern
2.During a saga choreography, the inventory-service fails to reserve items. What happens next?
- AThe order-service compensates by cancelling the order.
- BThe saga halts and waits for manual intervention.
- CThe billing-service charges the payment.
- DThe inventory-service retries the reservation indefinitely.
3.A service is using RabbitMQ for event notification. What is a key characteristic of this pattern?
- AInvolves compensating transactions
- BRequires a central coordinator
- CUses synchronous request-reply
- DFire-and-forget approach
4.A developer mistakenly believes that in RabbitMQ, a service must know all consumers of its events. What is the reality?
- AServices must register all consumers in advance.
- BEach service must maintain a list of active consumers.
- CConsumers are automatically discovered by RabbitMQ.
- DServices publish to their own exchanges without knowing consumers.
5.In a request-reply pattern using RabbitMQ, what is the role of the 'reply-to' queue?
- AIt is used to broadcast messages to multiple consumers.
- BIt holds all incoming requests for processing.
- CIt specifies where the consumer should send the response.
- DIt acts as a backup in case of message failure.
6.A developer claims that saga choreography requires a central coordinator. What is the correct understanding?
- AServices self-organise through events without a central coordinator.
- BThe coordinator is optional and used only for compensating transactions.
- COnly the first service in the saga needs a coordinator.
- DA central coordinator is mandatory for managing events.
7.An engineer observes that their microservice is tightly coupled with another due to shared exchanges. How can they resolve this?
- AUse a single, shared queue for all services
- BCombine all exchanges into one central exchange
- CImplement Exchange-Per-Service Pattern
- DSwitch to a direct exchange model
8.What happens if a service in a saga fails to publish a success event?
- AThe next service does not react, halting the saga.
- BThe previous service retries the operation.
- CThe entire saga is automatically rolled back.
- DThe saga continues to the next step regardless.