7.1 RequestNotification
Topic Version | 1 | Published | 10/16/2017 | |
For Standard | ETPW20 v1 |
To subscribe to change notifications, send the RequestNotification message.
The examples below use the following properties and example data.
Property Name |
Example |
---|---|
uri |
eml://witsml20/Trajectory(0655e8cd-b590-4f89-9b30-2a897db562ec) |
uuid |
0655e8cd-b590-4f89-9b30-2a897db562ec |
startTime |
1492566496661602 |
includeObjectData |
true When this flag is true, the store sends both the notification and the updated data object. |
objectTypes |
(none) |
Example NotificationRequest message:
// [5c7c2f28-4332-4c0f-acf5-a14aad678f3a] Message sent at 2017-04-18 20:48:21.0475{
"protocol":5,
"messageType":1,
"correlationId":0,
"messageId":6,
"messageFlags":0}{
"request": {
"uri": "eml://witsml20/Trajectory(0655e8cd-b590-4f89-9b30-2a897db562ec)",
"uuid": "23045b53-ffc5-44b6-bc69-5b9a628cb874",
"includeObjectData": true,
"startTime": 1492566496661602,
"objectTypes": [] }}
When a data object is changed (e.g., upsert or delete), the subscriber receives notification messages (and the updated data object, if the includeObjectData flag is true).
Example upsert ChangeNotification message:
// [848b3bb0-76b4-4707-b38d-868dd0b4dadc] Message received at 2017-04-18 20:58:50.4440{
"protocol":5,
"messageType":2,
"correlationId":3,
"messageId":7,
"messageFlags":0}{
"change": {
"changeType": "Upsert",
"changeTime": 1492567130384390,
"dataObject": {
"resource": {
"uri": "eml://witsml20/Trajectory(0655e8cd-b590-4f89-9b30-2a897db562ec)",
"contentType": "application/x-witsml+xml;version=2.0;type=Trajectory",
"name": "Plan #2",
"channelSubscribable": true,
"customData": {},
"resourceType": "DataObject",
"hasChildren": -1,
"uuid": "0655e8cd-b590-4f89-9b30-2a897db562ec",
"lastChanged": 1492567128810000,
"objectNotifiable": true },
"contentEncoding": "gzip",
"data": [ binary data truncated for readability ] } }}
Example DeleteNotification message:
NOTE: Per Sect 3.4.6.3 of the ETP Specification, for deleted objects, the object data is not present irrespective of the value of the includeObjectData field in the original request.
// [848b3bb0-76b4-4707-b38d-868dd0b4dadc] Message received at 2017-04-18 20:59:53.6191{
"protocol":5,
"messageType":3,
"correlationId":3,
"messageId":9,
"messageFlags":0}{
"delete": {
"changeType": "Delete",
"changeTime": 1492567193611638,
"dataObject": {
"resource": {
"uri": "eml://witsml20/Trajectory(0655e8cd-b590-4f89-9b30-2a897db562ec)",
"contentType": "application/x-witsml+xml;version=2.0;type=Trajectory",
"name": "Plan #2",
"channelSubscribable": true,
"customData": {},
"resourceType": "DataObject",
"hasChildren": -1,
"uuid": "0655e8cd-b590-4f89-9b30-2a897db562ec",
"lastChanged": 1492567128810000,
"objectNotifiable": true } } }}