Skip to content

Discussion about the message models #3

@gvannoye

Description

@gvannoye

As a reminder, the message formats are described in the task list:

I have some questions and remarks concerning the SNEWSObservation model:

  1. Should we use only one dataclass for the three tiers of message? I believe it is difficult for a dataclass to have optional fields, so that would mean leaving some fields blank when sending the message. If we do so, do we add an identifier for the tier of the message?
  2. When creating a SNEWSObservation object, a message_id field is required. The documentation indicates that it is “for the purpose of recording and tracing messages for SNEWS usage”, but this raises the question: should every id of every message be unique?
    If so that would mean that every experiment should listen to the SNEWSOBSERVATION topic and record the ids to avoid duplicates, in this case an id that is given server side would surely be more efficient.
    Another possibility is that the id is unique for a given experiment (meaning that experiments need to keep track of the number of alerts they sent).
  3. I believe letting each field containing an arbitrary string is a bad idea (perhaps it was done that way waiting for the decision of the proper format). By restricting what the model can be, errors can be avoided and the handling of message should be easier server-side.
    One possibility is to verify each string (either by verifying they are in a list of authorized strings, or by parsing them to verify the format) at the creation of the object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions