The event synchronization service of the censhare Server publishes asset event to the censhare-events-topic.
Description
The censhare Server uses an event-based approach. It communicates between various modules and services by sending and handling events. There are two different types of events:
- Asset-related events, for example Asset new master file, Create asset, etc. It is also possible to define custom events.
- Non-asset events (system events), for example Server ready or refreshing of master data.
Message
The payload of the record is encoded as a JSON string. No binary format is supported.
Field description
Field | Description |
---|---|
events | Array with events. |
events[].assetId | Asset ID. This field is only used with asset events. For system events, it is set to "0". |
events[].ccn | Asset CCN number. This field is only used with asset events. For system events, it is set to "-1". |
events[].version | Asset version. This field is only used with asset events. For system events, it is set to "0". |
events[].command | Command name. |
events[].target | Event target (name of the process that created this event). |
events[].method | Event method (type of event). |
events[].source | [Optional] Source of event (transaction id, may be null). |
events[].description | [Optional] Description of source event. |
events[].serverName | [Optional] Originating server name. |
events[].userId | ID of the user who posted this event (-1 means not set). |
events[].params[8] | Event parameters (up to 8 parameters). |
events[].xmlParam | [Optional] XML Parameter |
Examples
System event
{
"events":
[
{
"assetId":0,
"ccn":-1,
"version":0,
"command":"system.event.forward",
"target":"CacheManager",
"method":"refresh",
"serverName":"master",
"userId":-1,
"params":["corpus","en","domain"],
"xmlParam":"<CacheManager timestamp=\"2021-02-09T12:26:53.286Z\"
schema-name=\"corpus\" table-name=\"domain\" locale=\"en\"><new>
<domain corpus:dto_flags=\"p\" pathid=\"root.test.\" parent=\"root.\"
shortname=\"test\" name=\"Test\" sorting=\"3\" enabled=\"1\"
tcn=\"0\" rowid=\" 4\"/></new></CacheManager>"
}
]
}
Asset event
{
"events":
[
{
"assetId": "15614",
"ccn": 1,
"version": 1,
"command": "event.forward-20200508-1135-0",
"target": "AssetEvent",
"method": "new-master-file",
"source": "master.20200513.165800.936",
"serverName": "master",
"userId": -1,
"params": ["15614", "1", "0", "assets", "corpus:15614"]
}
]
}
Configuration
The topic has been created with the following values:
Parameter | Value |
---|---|
Partitions | 8 |
Replicas | 3 |