Closed Zendarq closed 4 years ago
Yes. You can see the use of include in the following samples.
I can do that with types yes but in your common-types.xml
Can I include something like below within the common-types.xml so that this message can be shared among other schemas?
<sbe:message name="Car" id="1" description="Description of a basic Car">
<field name="serialNumber" id="1" type="uint64"/>
<field name="modelYear" id="2" type="ModelYear"/>
<field name="available" id="3" type="BooleanType"/>
<field name="code" id="4" type="Model"/>
<field name="someNumbers" id="5" type="someNumbers"/>
<field name="vehicleCode" id="6" type="VehicleCode"/>
<field name="extras" id="7" type="OptionalExtras"/>
<field name="discountedModel" id="8" type="Model" presence="constant" valueRef="Model.C"/>
<field name="engine" id="9" type="Engine"/>
<group name="fuelFigures" id="10" dimensionType="groupSizeEncoding">
<field name="speed" id="11" type="uint16"/>
<field name="mpg" id="12" type="float"/>
<data name="usageDescription" id="200" type="varStringEncoding"/>
</group>
<group name="performanceFigures" id="13" dimensionType="groupSizeEncoding">
<field name="octaneRating" id="14" type="Ron"/>
<group name="acceleration" id="15" dimensionType="groupSizeEncoding">
<field name="mph" id="16" type="uint16"/>
<field name="seconds" id="17" type="float"/>
</group>
</group>
<data name="manufacturer" id="18" type="varStringEncoding"/>
<data name="model" id="19" type="varStringEncoding"/>
<data name="activationCode" id="20" type="varAsciiEncoding"/>
</sbe:message>
Yes. You need to get the XML and namespacing correct. This is more an XML than an SBE issue.
can you offer an example?? I also want to add a message to the common xml,thank you~
Create a file common-msg.xml
<?xml version="1.0" encoding="UTF-8"?>
<sbe:message xmlns:sbe="http://fixprotocol.io/2016/sbe"
name="Bar" id="2" description="Description of Bar">
<field name="foo" id="1" type="uint64"/>
</sbe:message>
Then include it in the target.
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe"
xmlns:xi="http://www.w3.org/2001/XInclude"
package="baseline"
id="1"
version="0"
semanticVersion="5.2"
description="Example base schema which can be extended."
byteOrder="littleEndian">
<xi:include href="common-types.xml"/>
...
<sbe:message name="Car" id="1" description="Description of a basic Car">
<field name="serialNumber" id="1" type="uint64"/>
<field name="modelYear" id="2" type="ModelYear"/>
<field name="available" id="3" type="BooleanType"/>
<field name="code" id="4" type="Model"/>
<field name="someNumbers" id="5" type="someNumbers"/>
<field name="vehicleCode" id="6" type="VehicleCode"/>
<field name="extras" id="7" type="OptionalExtras"/>
<field name="discountedModel" id="8" type="Model" presence="constant" valueRef="Model.C"/>
<field name="engine" id="9" type="Engine"/>
<group name="fuelFigures" id="10" dimensionType="groupSizeEncoding">
<field name="speed" id="11" type="uint16"/>
<field name="mpg" id="12" type="float"/>
<data name="usageDescription" id="200" type="varAsciiEncoding"/>
</group>
<group name="performanceFigures" id="13" dimensionType="groupSizeEncoding">
<field name="octaneRating" id="14" type="Ron"/>
<group name="acceleration" id="15" dimensionType="groupSizeEncoding">
<field name="mph" id="16" type="uint16"/>
<field name="seconds" id="17" type="float"/>
</group>
</group>
<data name="manufacturer" id="18" type="varStringEncoding"/>
<data name="model" id="19" type="varStringEncoding"/>
<data name="activationCode" id="20" type="varAsciiEncoding"/>
</sbe:message>
<xi:include href="common-msg.xml"/>
</sbe:messageSchema>
Is there a way to share a common set of sbe:message using?
In the NASDAQ protocols, the ITCH, NBBO, LastSale protocol messages have common symbology spin messages.
I wanted to see if I can use a common sbe:message definition and then include that within each of the protocol specs.
Is this possible?