SAP_CAPintermediate
Events and messaging
Distinguish domain events broker delivery and idempotent consumers
Overview
Distinguish domain events broker delivery and idempotent consumers
Lessons in this topic
- Events and messaging — SAP Guided TutorialEmitting and consuming events in CAP, connecting to SAP Event Mesh or file-based messaging for local tests, using the transactional outbox so events are published only after commit, and writing idempotent consumers for at-least-once delivery.
Interview questions covered
- How do you guarantee that an event is only published if the database change was committed?
- Design an idempotent consumer for a 'PaymentReceived' event.
How to study Events and messaging
Events and messaging has 1 lesson (1 intermediate) with about 5 minutes of reading in total. Start with the lesson that matches your level, then read the real project scenario and common mistakes in each one before moving on. After the lessons, say the 2 interview questions out loud in your own words, then check yourself against the model answer in each question (shown once you open it). Use the 4 mock questions to check recall.
Mock test questions covered
Try answering each one before you open the mock test; the answer options and scoring are in the Mock Questions tab.
- Why use CAP's persistent (transactional) outbox for events?
- Which messaging kind is appropriate for running event tests locally without a broker?
- What should an event payload usually contain?
- A consumer received the same OrderCreated message twice. What is the correct design response?