Advanced programming
How to onboard a new venue
Use this workflow for production onboarding.
- Get the venue XML SBE template and protocol documentation.
- Parse schema and inspect model:
- Identify framing header format (often documented outside XML template):
- Identify message header layout and check for custom header fields:
- Check repeating-group headers for custom extensions.
- Find custom composites and choose handling mode:
- stateful object;
- stateless interface;
- virtual fields.
- Composite data guide
- Build MessageSchema and ByteDecoder:
- Configure runtime safety switches:
- Validate decode/encode flow with real payload samples:
API map for integration
Use this quick mapping when implementing code:
- Schema and metadata:
- Runtime decoder:
- Message access:
- Composite handling:
Related documentation pages:
Value narrowing
Narrowing is conversion between integer types with different ranges. It appears when API method type does not match schema field type.
Examples:
int32 -> int16: valid range is[-32768..32767].int16 -> uint32: valid range is[0..32767].uint16 -> int16: valid range is[0..32767].uint8 -> int16: always valid.
Narrowing can happen in two places:
- Write narrowing: setter value type is wider than field type.
Example: field is
int8, code usessetInt(...). - Read narrowing: getter type is narrower than field type.
Example: field is
int32, code usesgetShort(...).
By default, narrowing is disabled. Without narrowing, use matching getter/setter pairs for field type.
Configure narrowing in DecoderSettings:
| Operation | Narrowing enable | Narrowing validation |
|---|---|---|
| Read | setEnableNarrowingOnRead / enableNarrowingOnRead | setValidateNarrowingOnRead / validateNarrowingOnRead |
| Write | setEnableNarrowingOnWrite / enableNarrowingOnWrite | setValidateNarrowingOnWrite / validateNarrowingOnWrite |
Recommendation:
- do not enable narrowing unless you need it;
- if enabled, also enable validation flags.
DecoderSettings.createFullControlSettings() returns preset with all narrowing flags enabled and validated.
Java SBE Decoder