FIXTradingCommunity / fix-simple-binary-encoding

A FIX standard for binary message encoding
Other
262 stars 69 forks source link

How unique should message member's `id` be? #151

Closed OleksandrKvl closed 2 years ago

OleksandrKvl commented 2 years ago

Just want to clarify, my understanding of documentation is that field/group/data id should be unique in message schema, is that right? I'm asking because in Euronext MDG schema you can see that inside each repeating group field IDs are starting from 1 just like fields on the top level. RealLogic generator also checks ID uniqueness only per message level, not per whole message. Should ID be unique per whole message (which means RealLogic is wrong and Euronext schema is broken) or only per message level?

donmendelson commented 2 years ago

In SBE, field ID is only in metadata, not on the wire. The specification states:

Unique field identifier (FIX tag)

The scope of uniqueness is not specified, however, so the Real Logic and Euronext schemas do not contradict the spec.

From a FIX perspective, the SBE ID was intended to correlate to a stable identifier in the FIX application layer. See the online specification here: https://www.fixtrading.org/online-specification/

OleksandrKvl commented 2 years ago

@donmendelson you're right, in the table about field attributes there's no uniqueness requirements, however in Schema validation section there is a statement:

Duplicate ID or name of field or group. Attributes id and name must uniquely identify a type within a message schema. This applies to fields and groups.

To me it sounds like ID must be unique within a message. Thanks for the answer, I will close the issue since you answered my question. If you think that documentation should be fixed, feel free to reopen it.

OleksandrKvl commented 2 years ago

@donmendelson just found in this table:

Name and id must uniquely identify a field type within a message schema.

Under this statement your previous answer doesn't look good. I also have related question: how unique should message member name be? Documentation says the same "must uniquely identify a field within a message schema", however Real Logic generator allows fields with the same name on different message levels (btw it does the same for IDs, i.e. same IDs are not allowed on the same level but are OK on different levels).