You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our company we send multiple SBE protocols over the same wire. This can be done because our message header contains the schemaId and we are able to distinguish between different schemas. However we do have some issues with the API, at least with C++ (I don't know APIs of other languages).
schemaId may not be the first field.
Different schemas may have different message headers with different order of fields and with possible extra fields. To be able to distinguish them you should:
First read the schema ID of the received message
Parse header using the correct message header type.
To achieve that:
The schemaId field needs to be of the same size - this is indeed recommended (uint16)
The schemaId field needs to be at the same offset in all schemas. The obvious position should be 0. This unfortunately is not done. Not only the code generator does not warn you about placing this field somewhere later inside the schema, but the official documentation shows bad examples:
<composite name="messageHeader" description="Template ID and length of message root">
<type name="blockLength" primitiveType="uint16"/>
<type name="templateId" primitiveType="uint16"/>
<type name="schemaId" primitiveType="uint16"/>
<type name="version" primitiveType="uint16"/>
<type name="numGroups" primitiveType="uint16" />
<type name="numVarDataFields" primitiveType="uint16" />
</composite>
No way to parse only the schemaId
The generated code should provide some function to parse only the schemaId field without parsing the whole header since it is unknown which header type should be used.
The text was updated successfully, but these errors were encountered:
In our company we send multiple SBE protocols over the same wire. This can be done because our message header contains the
schemaId
and we are able to distinguish between different schemas. However we do have some issues with the API, at least with C++ (I don't know APIs of other languages).schemaId may not be the first field.
Different schemas may have different message headers with different order of fields and with possible extra fields. To be able to distinguish them you should:
To achieve that:
schemaId
field needs to be of the same size - this is indeed recommended (uint16)schemaId
field needs to be at the same offset in all schemas. The obvious position should be 0. This unfortunately is not done. Not only the code generator does not warn you about placing this field somewhere later inside the schema, but the official documentation shows bad examples:https://www.fixtrading.org/standards/sbe-online/
No way to parse only the schemaId
The generated code should provide some function to parse only the
schemaId
field without parsing the whole header since it is unknown which header type should be used.The text was updated successfully, but these errors were encountered: