Skip to Content
0
Jan 13, 2023 at 09:52 AM

Event Mesh issues 429 Error with SAP CAP

410 Views Last edit Jan 13, 2023 at 09:53 AM 2 rev

When doing some mass operation, we have some issues with Event Mesh in an NodeJS CAP project (Version 6.4.0)

{"level":"error","logger":"messaging","component_type":"application","correlation_id":"test@test.com","tenant_id":"","remote_user":"SYSTEM","timestamp":"2023-01-13T08:28:49.457Z","msg":"Emit failed {\n event: 'TestEvent',\n cause: Error: Authorization failed\n at _errorObj (node_modules/@sap/cds/libx/_runtime/messaging/http-utils/token.js:4:20)\n at IncomingMessage.<anonymous> (node_modules/@sap/cds/libx/_runtime/messaging/http-utils/token.js:39:25)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21) {\n target: { kind: 'TOKEN' },\n response: {\n body: '<html>\\r\\n' +\n '<head><title>429 Too Many Requests</title></head>\\r\\n' +\n '<body>\\r\\n' +\n '<center><h1>429 Too Many Requests</h1></center>\\r\\n' +\n '<hr><center>nginx</center>\\r\\n' +\n '</body>\\r\\n' +\n '</html>\\r\\n',\n headers: [Object],\n statusCode: 429\n }\n }\n}","layer":"cds"}

What is the best way to deal with this issues? I know that from the message we call too many request, but how much is "Too many request" for Event Mesh? And when we get that 429 Error, how long should we wait before emit other event?