cds-event-monitoring
A CAP plugin that stores every event received on its configured messaging topics in a table, with a Fiori-annotated service to browse them, resend events and drain a dead-message queue.
Subscribes to the messaging topics named in its configuration, writes every event it receives into an EventData entity, and exposes EventMonitoringService over it, with actions to resend one event, to resend everything on a topic between two timestamps, and to consume and requeue a dead-message queue. retentionInDays deletes rows older than the given number of days, and only when a new event arrives; ignoreIdenticalEvents drops the repeats a retry produces. The Events projection carries Fiori annotations, so a monitoring UI is an app over the service rather than a screen to design, and extending EventData with a column fills it from the matching field in the event body. It records the topics and queues it is configured with by name, and consuming a dead-message queue acknowledges those messages, which takes them out of the broker.
Facts
Where it sits
Who is behind it
In the atlas: maintains 1, contributes to 1@chuckberrrymaintainer
Before choosing this
Conditions
LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
- § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
- § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
- § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
Also, from Async processing§ 1: Messaging is not automatically mass extraction, but an external broker can cross the boundary named in section 1. The data flow, volume and interoperability purpose therefore need to be checked for the concrete design.
What it declares
Every artifact
- Type
- CDS plugin
- Origin
- Independently maintained
- Runtime
- Node.js
As a CDS plugin
- Declared for
- >=7
- Distributed through
- npm
Connections
Doing work outside the request that triggered it, with retries
Emitting and consuming business events across systems through brokers
Download
Install
npm add cds-event-monitoringDerived from the package name. No recipe recorded; the README has the configuration.
README
quoted from chuckberrry/cds-event-monitoring under MIT, readCDS Event Monitoring Plugin
The Event Monitoring Plugin provides a robust event monitoring service capable of hooking into multiple topics and storing event data in a database table. It exposes this data through a CDS service that users can extend as needed. This is perfect if you want to keep track of your event data and need retry/resend functionalities. For an example of how to use this package, refer to the testProject folder of the github repository.
Features
- Event Monitoring for Multiple Topics
- Stores event data in a customizable CDS entity/table.
- Provides a default CDS service (EventMonitoringService) to interact with event data.
- Actions to resend individual events, all events, or dead-message queue events.
- Monitors and consumes messages from specified DMQs.
- Configurable retentionInDays setting to automatically delete old events.
- Duplicate Event Filtering
Table of Content
Setup
To enable event monitoring, add this plugin package to your project with the following command:
npm add cds-event-monitoring
Adding Required Configurations
This package requires specific configurations in your package.json or .cdsrc.json.
"cds": {
"requires": {
...
"event-monitoring": {
"retentionInDays": 7,
"topics": [
"<namespace>/<topic-name>"
],
"dead-message-queues": [
"<namespace>/<dead-message-queue-name>"
]
}
}
}
| Configuration Option | Type | Description |
|---|---|---|
| topics | Array of Strings | Defines the topics that the package will monitor. |
| retentionInDays (optional) | Integer | Specifies the number of days to retain events in the database. Events are deleted when a new event is detected. If no events are received, no deletion occurs. |
| ignoreIdenticalEvents (optional) | Boolean | If you want to ignore events with the same data (e.g., from retries), set this flag to true. Default: false. |
| dead-message-queues (optional) | Array of Strings | Defines the dead-message queues that will be monitored. Be aware that messages from the DMQ will be consumed and acknowledged. |
Default service definition
The package includes a default service definition, providing an endpoint for interacting with event data.
service EventMonitoringService {
action resendAll(topic : String, startTimestamp : Timestamp, endTimestamp : Timestamp);
action resendDeadMessageQueue(queue : String);
action sendToTopic(topic : String, message : LargeString);
entity Events as projection on EventData
actions {
action resend();
action resendToTopic(topic : String);
};
}
The resend action allows requeuing the event back into the original topic.
Extending the Service
To extend the existing service, add a new CDS service to your project and import the event monitoring service from the package:
using {EventMonitoringService} from 'cds-event-monitoring/srv';
extend EventMonitoringService with @(requires: 'admin');
In this example, the service is extended with a custom scope.
Extending the Service and Event Logic
You can create your own service implementation that extends the existing one. Use the @impl annotation to reference an implementation file.
extend EventMonitoringService with @(impl: 'srv/event-ext.js');
Next, import the existing service implementation and extend it with your own logic:
const cds = require('@sap/cds');
const EventServiceHandler = require('cds-event-monitoring/srv');
module.exports = class EventServiceExt extends EventServiceHandler {
async init() {
const messaging = await cds.connect.to('messaging');
// extend messaging behavior
messaging.on('*', (msg) => {
const { data, event } = msg;
console.log(data);
console.log(event);
});
// hook into CRUD events
this.after('each', (data) => {
console.log(data);
});
return super.init();
}
};
Note: New messaging handlers will execute before the event logic provided by the package, ensuring you do not overwrite existing logic.
Service extensions are also compatible with TS projects.
import cds from '@sap/cds';
import EventServiceHandler from 'cds-event-monitoring/srv';
export default class EventServiceExt extends EventServiceHandler {
async init() {
const messaging = await cds.connect.to('messaging');
// extend messaging behavior
messaging.on('*', (msg) => {
const { data, event } = msg;
console.log(data);
console.log(event);
});
return super.init();
}
}
Fiori annotations
The Events includes several predefined Fiori annotations, which can be used and extended to develop an event monitoring UI.
You can find an example in the testProject/app folder of the github repository.
Extending the database table
If you want to store specific fields in separate database columns (for example for searching purposes) you can do so, by extending the cds entity EventData.
using {event.monitoring.EventData} from 'cds-event-monitoring/db';
extend EventData with {
description : String;
}
The new fields will be automatically filled with the data of the incoming event. Make sure, that a corresponding data field is present in the event body. In this example e.g.
{
"data": {
...,
"description": "<description-string>"
}
}History
Others providing
- SAP Integration Suite, advanced event meshSAP Integration Suite, advanced event meshAn event streaming, event management and monitoring platform for event-driven architecture, offered within SAP Integration Suite.sap official, btpEvent streaming and management platform in Integration Suitefrom BTP/BAIP
- SAP Cloud Application Event HubSAP Cloud Application Event HubDistributes the business events SAP cloud applications publish to the other SAP cloud applications in a landscape, with subscriptions managed in its own UI and no topics or queues to configure.sap official, btpDistributes business events between SAP cloud applicationsfrom BTP/BAIP
- Event MeshEvent MeshManaged queues and topics over AMQP, MQTT and a REST gateway, and the bus SAP's own applications publish their business events to.sap official, btpManaged queues and topics over AMQP, MQTT and RESTfrom BTP/BAIP
- SAP Integration Suite, Event MeshSAP Integration Suite, Event MeshThe event broker activated inside SAP Integration Suite: queues, topic subscriptions and webhook subscriptions, reached over AMQP, MQTT and HTTP.sap official, btpEvent broker inside SAP Integration Suitefrom BTP/BAIP
- com.sap.cds:cds-feature-advanced-event-meshcom.sap.cds:cds-feature-advanced-event-meshA beta CAP Java plugin that adds SAP Integration Suite, advanced event mesh as a messaging broker, activated by setting a messaging service's kind to aem.sap official, capCAP Java plugin for SAP Integration Suite, advanced event meshfrom CAP
- com.sap.cds:cds-feature-enterprise-messagingcom.sap.cds:cds-feature-enterprise-messagingA CAP Java feature that connects a CAP messaging service to SAP Event Mesh, activated by setting the service's kind to enterprise-messaging, and looks up the bound instance.sap official, capConnects CAP Java messaging to SAP Event Meshfrom CAP
- com.sap.cds:cds-feature-event-hubcom.sap.cds:cds-feature-event-hubA CAP Java plugin that connects CAP's messaging service to SAP Cloud Application Event Hub, so an application sends and consumes business events without coding against its API.sap official, capConnects CAP Java messaging to SAP Cloud Application Event Hubfrom CAP
- com.sap.cds:cds-feature-kafkacom.sap.cds:cds-feature-kafkaA CAP Java feature that connects a CAP messaging service to Apache Kafka for intra-application messaging, through the Apache Kafka client library rather than a managed SAP messaging service.sap official, capConnects CAP Java messaging to Apache Kafkafrom CAP
- com.sap.cds:cds-feature-rediscom.sap.cds:cds-feature-redisA beta CAP Java feature that connects a CAP messaging service to Redis Pub/Sub, which broadcasts each event to every subscribed instance and does not guarantee delivery.sap official, capBeta connector from CAP Java messaging to Redis Pub/Subfrom CAP
- com.sap.cds:cds-services-bomcom.sap.cds:cds-services-bomThe Maven bill of materials for CAP Java, pinning every com.sap.cds module in a release, from the API and core runtime to the Spring Boot starters and the CQN engine, to the same version.sap official, capMaven bill of materials pinning CAP Java module versionsfrom CAP
- @cap-js/advanced-event-mesh@cap-js/advanced-event-meshIntegrates CAP with SAP Integration Suite advanced event mesh.sap official, capCAP integration with SAP Integration Suite advanced event meshfrom CAP
- @cap-js/asyncapi@cap-js/asyncapiExports AsyncAPI documents describing the events a CAP service emits and consumes.sap official, capExports AsyncAPI documents for a CAP service's eventsfrom CAP
- @cap-js/event-broker@cap-js/event-brokerConsumes events from SAP Cloud Application Event Hub.sap official, capConsumes events from SAP Cloud Application Event Hub in CAPfrom CAP
- cds-kafkacds-kafkaA Kafka adapter for CAP that registers Kafka topics as a CDS messaging service over KafkaJS, so emit and on work unchanged, with per-message keys, partitions and topics set through headers.independent, capKafka adapter exposing topics as a CDS messaging servicefrom CAP
- cesar-sap/abap_kafka_rest_proxycesar-sap/abap_kafka_rest_proxyAn ABAP connector that produces and consumes data to and from Kafka through the Confluent Kafka REST Proxy, since SAP NetWeaver ABAP has no native Kafka client; tested on ABAP 7.5x.independent, abapABAP connector to Kafka through the Confluent Kafka REST Proxyfrom ABAP
- gregorwolf/AWS_SNS4ABAPgregorwolf/AWS_SNS4ABAPAn ICF handler that receives Amazon SNS notifications in an ABAP system as an HTTPS subscriber endpoint, leaving what happens to a notification once it arrives to the caller.independent, abapICF handler receiving Amazon SNS notifications in an ABAP systemfrom ABAP
- INVIXO/abapMQINVIXO/abapMQAn MQTT client implemented in ABAP, supporting protocol version 3.1.1, so an ABAP program can publish and subscribe to a broker; it requires ABAP 750sp01 and installs through abapGit.independent, abapMQTT 3.1.1 client implemented in ABAPfrom ABAP
- MQBAMQBAAn implementation of MQTT publish/subscribe in ABAP, with a broker inside the system built on ABAP Push Channels and ABAP Messaging Channels, and a bridge to external non-SAP brokers.independent, abapMQTT publish/subscribe in ABAP with an external broker bridgefrom ABAP
- @sap/cds@sap/cdsThe CAP Node.js runtime, which compiles the CDS model, serves the services declared in it, answers generic requests before any handler runs, and loads every cds-plugin.sap official, capCAP Node.js runtimefrom CAP
- ABAP-PRCABAP-PRCA framework for custom multi-step ABAP processes: a process class declares the states, and the framework runs each document through them and monitors the run.independent, abapFramework for multi-step ABAP processes with monitoringfrom ABAP
- Event MeshEvent MeshManaged queues and topics over AMQP, MQTT and a REST gateway, and the bus SAP's own applications publish their business events to.sap official, btpManaged queues and topics over AMQP, MQTT and RESTfrom BTP/BAIP
- com.sap.cds:cds-services-bomcom.sap.cds:cds-services-bomThe Maven bill of materials for CAP Java, pinning every com.sap.cds module in a release, from the API and core runtime to the Spring Boot starters and the CQN engine, to the same version.sap official, capMaven bill of materials pinning CAP Java module versionsfrom CAP
- @cap-js-community/event-queue@cap-js-community/event-queueTransactional processing of asynchronous and periodic events, with instant dispatch over Redis Pub/Sub and load spread across every application instance.community org, capTransactional processing of asynchronous and periodic CAP eventsfrom CAP
- @cap-js-community/sap-afc-sdk@cap-js-community/sap-afc-sdkSDK for building SAP Advanced Financial Closing scheduling providers on CDS.community org, capSDK for SAP Advanced Financial Closing scheduling providers on CDSfrom CAP
- @odatano/watch@odatano/watchWatches Cardano addresses, payment credentials and minting policies from inside CAP, emitting events with full UTxO payloads and persisting them so a missed window can be replayed.independent, capCAP plugin watching Cardano addresses and emitting eventsfrom CAP
- @sap/cds@sap/cdsThe CAP Node.js runtime, which compiles the CDS model, serves the services declared in it, answers generic requests before any handler runs, and loads every cds-plugin.sap official, capCAP Node.js runtimefrom CAP
- cds-natscds-natsNATS as a messaging service for the CAP Node.js runtime, the broker behind cds.connect for emit and subscribe, for teams already running NATS rather than Event Mesh or Redis.independent, capNATS messaging service for the CAP Node.js runtimefrom CAP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:chuckberrry-cds-event-monitoring- JSON
- /artifacts/chuckberrry-cds-event-monitoring.json
- MCP
- Connecting an agent