Marking Events for CBOR Flow


Hi all -- During today's Core Working Group call as we were discussing various ways for export-distro / app-functions-sdk to notify core-data that an event had been successfully handled, I believe Eric Cotter suggested that another option might be to use a checksum. After taking a long walk this evening, I began to think that might be worth exploring. I wrote the following very simple harness to help illustrate the idea.

The README gives instructions on how to build and run the app. Each time the app is run, a different checksum will be generated, owing largely to the different timestamp values on the event and readings during each execution. We could potentially integrate this kind of solution in the following manner.

1.) A CBOR event comes in.

2.) We obtain a checksum value for the byte array

3.) We store that checksum as part of the Event model in core-data

4.) The CBOR byte array is published through the bus

5.) The subscriber receives the byte array and also calculates the checksum

6.) When the subscriber is done handling the event, it calls a PUT on core-data passing the checksum

    6a.) This would entail a modification to the request type of the existing API

7.) Core-data locates the event and marks it as "pushed"

Given all of the elements that go into an event and its readings, I think the chance of obtaining a duplicate checksum is remote. If that's naive, please correct me. I'm only suggesting we do this for CBOR events right now but it could be done for any event since all it needs is a byte array.

Trevor Conn
Senior Principal Software Engineer
Dell Technologies | IoT DellTech
Round Rock, TX  USA

Join to automatically receive all group messages.