You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java/outbox.md
+41-21Lines changed: 41 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ To enable the persistence for the outbox, you need to add the service `outbox` o
49
49
}
50
50
```
51
51
52
-
::: warning
52
+
::: warning
53
53
Be aware that you need to migrate the database schemas of all tenants after you've enhanced your model with an outbox version from `@sap/cds` version 6.0.0 or later.
54
54
:::
55
55
@@ -173,7 +173,7 @@ To avoid this, you can apply a manual workaround as follows:
173
173
1. Customize the outbox configuration and isolating them via distinct namespaces for each service.
174
174
2. Adapt the Audit Log outbox configuration.
175
175
3. Adapt the messaging outbox configuration per service.
176
-
176
+
177
177
These steps are described in the following sections.
178
178
179
179
#### Deactivate Default Outboxes
@@ -228,7 +228,7 @@ cds:
228
228
::: tip Important Note
229
229
It is crucial to **deactivate** the default outboxes, and ensure **unique outbox namespaces** in order to achieve proper isolation between services in a shared DB scenario.
230
230
:::
231
-
231
+
232
232
233
233
## Outboxing CAP Service Events
234
234
@@ -424,29 +424,50 @@ It is crucial to make the service `OutboxDeadLetterQueueService` accessible for
424
424
425
425
:::
426
426
427
-
### Filter for Dead Entries
428
-
429
-
This filtering can't be done on the database since the maximum number of attempts is only available from the CDS properties.
427
+
### Reading Dead Entries
430
428
431
-
To ensure that only dead outbox entries are returned when reading `DeadOutboxMessages`, the following code provides the handler for the `DeadLetterQueueService` and the `@After-READ` handler that filters for the dead outbox entries:
429
+
Filtering the dead entries is done by adding an appropriate `where`-clause to all `READ`-queries which matches all outbox message entries that have been retried for the maximum number of times. The following code provides an example handler implementation defining this behavior for the `DeadLetterQueueService`:
@@ -488,8 +509,7 @@ The injected `PersistenceService` instance is used to perform the operations on
488
509
[Learn more about CQL statement inspection.](./working-with-cql/query-introspection#cqnanalyzer){.learn-more}
489
510
490
511
::: tip Use paging logic
491
-
Avoid to read all entries of the `cds.outbox.Messages` or `OutboxDeadLetterQueueService.DeadOutboxMessages` table at once, as the size of an entry is unpredictable
492
-
and depends on the size of the payload. Prefer paging logic instead.
512
+
Avoid reading all outbox entries at once in case entries which have large request payloads are present. Prefer `READ`-queries with paging instead.
0 commit comments