OnixS C++ CME iLink 3 Binary Order Entry Handler  1.18.3
API Documentation
Handling Business Reject Messages

The exchange can send the Business Message Reject message to reject an application-level message which fulfills session-level rules but fails the business rules.

This message is reported via the OnixS::CME::iLink3::SessionListener::onBusinessReject method.

Note
When the sequence number of the rejected message is absent in the received "Business Message Reject" message, this indicates the exchange did not increment the message sequence number of the rejected application-level message and:
  • The client system should not increment the message sequence number of the next business message to be sent
  • If the client system increments the message sequence number of the next application-level message to be sent, a NotApplied message will be sent to the customer to let them know that the sequence number has not been applied by the exchange.

Code Example

using namespace OnixS::CME::iLink3;
class NotAppliedListener : public SessionListener
{
public:
void onBusinessReject(const Messaging::BusinessReject521& reject, Session* session) override
{
std::clog << "\nReceived:\n" << reject << std::endl
<< "\tReject reason: " << BusinessRejectReason::toString(reject.businessRejectReason()) << std::endl;
UInt32 rejectedMessageSequenceNumber;
if (reject.refSeqNum(rejectedMessageSequenceNumber))
{
std::clog << "The sequence number of the rejected message is " << rejectedMessageSequenceNumber << std::endl;
}
else
{
// If the sequence number of the rejected message is absent,
// the client system does not need to increment the sequence number of the next business message to be sent.
session->outSeqNum(session->outSeqNum() - 1);
}
}
};