Docs / Outbound Messaging
Message Sequencing
Sequencing ensures ordered delivery for related events so consumers do not need to compensate for out-of-order processing during retries or parallel execution.
Overview
The sequencing process includes three core steps:
- Persist generated payload to the outbox context.
- Acquire an exclusive lock for the sequence key.
- Process earlier pending payloads for the same key before the current payload.
If any step fails, remaining payloads stay queued and are processed on the next retry cycle or next event for the same key.
Via SAP GUI
In /ASADEV/ACI_SETTINGS maintain header attributes on the outbound object:
| Header Attribute | Value | Description |
|---|---|---|
SEQUENCING | X | Activates sequencing for this outbound object |
SEQUENCE_OBJECT | Logical object name | Defines sequence grouping object |
SEQUENCE_KEY | Business key | Defines sequence grouping key |
USE_EVENT_DATA | X | Uses RAP event payload instead of extraction for supported scenarios |
Note: SEQUENCE_OBJECT and SEQUENCE_KEY can be shared across multiple outbound objects (for example header and item events) to preserve global ordering across related interfaces.
Via Event Studio
Event Studio deployment supports the same sequencing model. Configure sequencing-relevant header fields during deployment to keep parity with SAP GUI settings.
Outbox Pattern
For strict transactional ordering, implement outbox persistence in application logic using class /ASADEV/CL_OUTBOX_COLLECTOR with methods PREPARE_ENTRY and SAVE_ENTRIES.
Combine RAP Event Data and Outbox Pattern
For combined RAP+Outbox scenarios, implement BAdI /ASARAP/EVENT_DATA_BADI in the receiver flow. Method ADJUST_EVENT_DATA should provide outbox correlation IDs and adapted references so event payloads map to outbox entries correctly.