SBE Message
The 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 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 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);
message.SetByte(Tag.Side, (byte)Side.Buy);
message.SetString(Tag.SenderID, "GFP");
message.SetString(Tag.ClOrdID, "OrderId");
message.SetUnsignedLong(Tag.OrderRequestID, 1u);
message.SetString(Tag.Location, "UK");
message.SetChar(Tag.OrdType, (char)OrderType.Limit);
message.SetByte(Tag.TimeInForce, (byte)TimeInForce.Day);
message.SetInteger(Tag.SecurityID, securityId);
message.SetUnsignedInteger(Tag.OrderQty, 1);
message.SetDecimal(Tag.Price, price);
message.SetByte(Tag.ManualOrderIndicator, (byte)ManualOrdInd.Automated);
message.SetChar(Tag.ExecutionMode, (char)ExecMode.Aggressive);
message.SetByte(Tag.ExecInst, (byte)ExecInst.AON);