SBE Message
The OnixS.SimpleBinaryEncoding.IMessage
represents a Simple Binary Encoding (SBE) message.
The details about SBE can be found at the
iLink 3 - Simple Binary Encoding
page.
SBE Messages
The Handler exposes generic tag-based interface OnixS.SimpleBinaryEncoding.IFieldSet
,
which provide interfaces to manipulate SBE message fields and repeating groups.
For fast access to message fields, the Handler generates in-memory wrapper classes, which implements such an interface.
Constructing SBE Message
To create an SBE message object, there is a need to use the OnixS.SimpleBinaryEncoding.IEncoder
object provided by the session. It creates the underlying buffer and the message wrapper around it.
The following example demonstrates how SBE messages can be created.
const int NewOrderSingleTemplateId = 514;
IEncoder encoder = session.CreateEncoder();
IMessage message = encoder.Wrap(NewOrderSingleTemplateId);
message.SetUnsignedLong(Tag.PartyDetailsListReqID, partyDetailsListReqID)
.SetByte(Tag.Side, (byte)Side.Buy)
.SetString(Tag.SenderID, "GFP")
.SetString(Tag.ClOrdID, "OrderId")
.SetUnsignedLong(Tag.OrderRequestID, 1u)
.SetString(Tag.Location, "UK")
.SetChar(Tag.OrdType, (char)OrderType.Limit)
.SetByte(Tag.TimeInForce, (byte)TimeInForce.Day)
.SetInteger(Tag.SecurityID, securityId)
.SetUnsignedInteger(Tag.OrderQty, 1)
.SetDecimal(Tag.Price, price)
.SetByte(Tag.ManualOrderIndicator, (byte)ManualOrdInd.Automated)
.SetChar(Tag.ExecutionMode, (char)ExecMode.Aggressive)
.SetByte(Tag.ExecInst, (byte)ExecInst.AON);