Skip to content

Commit c7c28c8

Browse files
authored
Fully support cds queued (#391)
* fully support cds queued * fully support cds queued * fully support cds queued
1 parent a2dccfd commit c7c28c8

File tree

11 files changed

+279
-169
lines changed

11 files changed

+279
-169
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## v1.12.0 - 2025-XX-XX
9+
10+
### Added
11+
12+
- fully support cds.queued
13+
814
## v1.11.0 - 2025-07-09
915

1016
### Added

docs/unit-testing/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ it("should process an outboxed service", async () => {
145145
await tx.rollback();
146146
expect(publishedEvent[0]).toMatchObject({
147147
type: "CAP_OUTBOX",
148-
subType: "sendFiori",
148+
subType: "NotificationService",
149149
status: EventProcessingStatus.Open,
150150
});
151151
expect(service).not.sendFioriActionCalled(); // this is pseudo code
@@ -169,14 +169,14 @@ it("should process an outboxed service", async () => {
169169
});
170170

171171
// Act - process the event
172-
await processEventQueue({}, "CAP_OUTBOX", "sendFiori"); // parameters are cds context, type, and subType
172+
await processEventQueue({}, "CAP_OUTBOX", "NotificationService"); // parameters are cds context, type, and subType
173173

174174
// Assert
175175
tx = cds.tx({});
176176
const publishedEvents = await tx.run(SELECT.from("sap.eventqueue.Event"));
177177
expect(publishedEvent[0]).toMatchObject({
178178
type: "CAP_OUTBOX",
179-
subType: "sendFiori",
179+
subType: "NotificationService",
180180
status: EventProcessingStatus.Done,
181181
});
182182
expect(service).sendFioriActionCalled(); // this is pseudo code

docs/use-as-cap-outbox/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ The implementation below demonstrates a basic `cds.Service` that can be outboxed
143143
via `cds.env.requires`, the service needs to inherit from `cds.Service`.
144144

145145
```js
146-
class TaskService extends cds.Service {
146+
const cds = require("@sap/cds");
147+
148+
module.exports = class TaskService extends cds.Service {
147149
async init() {
148150
await super.init();
149151
this.on("process", async function (req) {
150152
// add your code here
151153
});
152154
}
153-
}
155+
};
154156
```
155157

156158
Outboxing can be enabled via configuration using `cds.env.requires`, for example, through `package.json`.

0 commit comments

Comments
 (0)