The definition of a new event in ClientMessageDtos.proto is as follows:
message NewEvent {
required bytes event_id = 1;
required string event_type = 2;
required int32 data_content_type = 3;
required int32 metadata_content_type = 4;
required bytes data = 5;
optional bytes metadata = 6;
}
``
Why are data_content_type and metadata_content_type int32 values?
I would expect them to be simply a string like the one used in the HTTP header fields:
Content-Type: application/xml; charset=ISO-8859-4
This would allow to get all the necessary information for handling the byte structure from this header before actually reading it.
It should even possible to allow encrypted or versioned content:
data_content_type: multipart/encrypted; protocol=“application/pgp-encrypted”; boundary="------------24i8m5cu37hapwm904t8v"
``
data_content_type: application/xml; charset=utf-8; type=MyEvent; version=1.0.2
meta_data_content_type: application/json; charset=utf-8; type=MyMeta; version=1.1.0
``