cancel
Showing results for 
Search instead for 
Did you mean: 

Start CAP without express to run a Cloud Foundry task

gregorw
Active Contributor
0 Kudos

Hello CAP Team, Hi @Daniel7,

I have a CAP application that creates quite huge Excel files and allows also the upload of the edited files. The uploaded files are processed and data is written to S/4HANA. This download and upload processing is quite resource extensive and sometimes blocks the interactive usage of the application. Due to that reason I want to do the processing in a Cloud Foundry Task. Marius Obert lists "Running a data processing script" as one use cases in the blog post CloudFoundryFun #4 – How to use Cloud Foundry Tasks.

So I went forward and created a first prototype with srv/loadDataFromMock.js. As I do not need a CAP Server providing an HTTP endpoint I used (with a hint from @david_kunz2  ) the example from the CAP documentation for the Built-in server.js. What would be great if @sap/cds/server.js would provide directly a way to start the CAP standard server but just without express and a http server.

Best Regards
Gregor

Accepted Solutions (0)

Answers (1)

Answers (1)

maxgruenfelder
Employee
Employee
0 Kudos

For executing heavy load tasks and periodic events in CAP you can use the following package:

https://github.com/cap-js-community/event-queue/

https://cap-js-community.github.io/event-queue/

The packages allow you to execute jobs and periodic job asynchronously for every onboarded tenant. The package does not require any additional services or components.