How to configure FIX messages throttling in FIX Antenna C++

Configure throttling of outgoing messages

Throttling outgoing messages is available since FIX Antenna 2.30.0 release.

Throttling outgoing messages allows limiting the amount of sent FIX messages within a time interval.

Overview

If throttling of outgoing messages is configured for the session, FIX Antenna sends to the counterparty the particular amount of messages (MessagesLimit) within the specified time interval (IntervalMs) using the mechanism defined in the Type property. 

If the amount of sent FIX messages exceeds the specified MessagesLimit within the configured IntervalMs then the outgoing message will be added to the queue. 

Configuration example

Throttling properties must be configured in the engine.properties file:

engine.properties
Session.<SenderId>/<TargetId>.Throttlers = MyGeneralOutLimiter1, MyGeneralOutLimiter2

Session.<SenderId>/<TargetId>.Throttlers.MyGeneralOutLimiter1.Direction = Outgoing
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralOutLimiter1.Type = SlidingWindowMessages
# throttler type dependent parameters
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralOutLimiter1.MessagesLimit = 50
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralOutLimiter1.IntervalMs = 2000

Session.<SenderId>/<TargetId>.Throttlers.MyGeneralOutLimiter2.Direction = Outgoing
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralOutLimiter2.Type = SlidingWindowMessages
# throttler type dependent parameters
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralOutLimiter2.MessagesLimit = 100
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralOutLimiter2.IntervalMs = 3000

Please refer to the Throttling parameters page for more information about throttling properties.

If at least one of these parameters is specified with an incorrect value then the FIX session will not be created.

Configure throttling of incoming messages

Throttling incoming messages is available since FIX Antenna 2.31.0 release.

Throttling incoming messages allows limiting the amount of received FIX messages within a time interval.

Overview

If throttling of incoming messages is configured for the session, FIX Antenna receives from the counterparty the particular amount of messages (MessagesLimit) within the specified time interval (IntervalMs) using the mechanism defined in the Type property.

If the amount of received FIX messages exceeds the specified MessagesLimit within the configured IntervalMs then the onIncomingThrottling callback with the particular DefaultAction will be called.

When configuring several throttlers for the session, they must be listed in the Throttlers parameter in the order of severity.

Configuration example

Throttling properties must be configured in the engine.properties file:

engine.properties
Session.<SenderId>/<TargetId>.Throttlers = MyGeneralInLimiter1, MyGeneralInLimiter2

Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter1.Direction = Incoming
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter1.Type = SlidingWindowMessages
# throttler type dependent parameters
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter1.MessagesLimit = 10000
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter1.IntervalMs = 10000
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter1.DefaultAction = TerminateWithLogout  

Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter2.Direction = Incoming
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter2.Type = SlidingWindowMessages
# throttler type dependent parameters
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter2.MessagesLimit = 100
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter2.IntervalMs = 10000
Session.<SenderId>/<TargetId>.Throttlers.MyGeneralInLimiter2.DefaultAction = SendReject  

Log messages

If the MessagesLimit or IntervalMs property is specified with an incorrect value, the warning below will be logged:

WARN <Session_Name> session cannot be started now. Reason: <parameter>: max items in interval cannot be <value>.

If the Direction, Type or DefaultAction property is specified with an incorrect value, the error below will be logged:

ERROR <Session_Name> session can't be configured and won't be started because: invalid value of parameter <parameter>.

If at least one of MessagesLimit, IntervalMs, Direction, and Type properties is absent, then the error below will be logged:

ERROR <Session_Name> session can't be configured and won't be started because: absent required value of parameter <parameter>.