When an application sends FIX messages at a high rate, there can be overflow issues. This can happen for different reasons, e.g., the outgoing TCP buffer size is not enough, slow network, the counterparty cannot process received messages in time, etc. Such issues can have a negative impact on the application and lead to disconnections of FIX connections.
Therefore, it makes sense to detect such issues on the application level and try to prevent them. When a session sends a FIX message and the send socket function fails, the serialized FIX message is stored in the sending queue for the subsequent sending by the sending thread. To control that there are no pending messages in this sending queue, one can use the OnixS::FIX::Session::outboundQueueBytes method. If this method returns a large value, which increases in time, then there is an overflow issue, so it makes sense to wait to send messages until this value is decreasing, for example:
Additionally, one can set a limit of the sending queue size in bytes via the OnixS::FIX::Session::sendQueueMaxSize method or the corresponding Engine's setting. The TCP connection will be disconnected when an overflow issue happens and the sending queue size exceeds this limit.