Replaying Messages
Note:
If you use the ‘offsetType’ parameter in the subscribe message, then events that occurred before that parameter was used are not included in any message replay.
The OHIP schema includes the metadata attribute "offset," which is the message number.
To replay messages already received, specify the offset value following the chainCode. For example in Postman:
{
"id": "1",
"type": "subscribe",
"payload": {
"variables": {},
"extensions": {},
"operationName": null,
"query": "subscription { newEvent(input: { chainCode: \"<CHAIN CODE>\" offset: \"<OFFSET>\" } ) { metadata { offset } moduleName eventName detail { oldValue newValue elementName } } }"
}
}
In GraphiQL add the offset parameter after the chainCode. For example:
subscription{
newEvent(input:{chainCode: \"<CHAIN CODE>\" offset: \"<OFFSET>\"}) {
moduleName
eventName
detail{
newValue
oldValue
elementName
}
metadata{
offset
uniqueEventId
}
}
}
OHIP sends event 193 and all events that occurred after event 193.
As noted in Broken Connections, if offset 193 was emitted more than 7 days ago, OHIP will return all messages emitted since 7 days ago. This is because OHIP retains events for only 7 days.
Parent topic: Streaming API (push)