• Programming Guide
  • Api Documentation
  • OnixS CME iLink3 Handler for .NET Core, version 1.4.2
Show / Hide Table of Contents
  • Introduction
  • System Requirements
  • Getting Started
    • Error Reporting
    • Licensing
    • SBE Message
      • Tag-based Messaging
      • Message Fields
      • Repeating Groups
    • iLink 3 Session
      • Universally Unique Identifier
      • Establishing iLink3 Connection
      • Exchanging Messages
      • Message Sequence Numbers
  • Configuring the Handler
    • Configuration File Examples (XML or JSON)
  • Logging
  • Session Storage
    • File-Based Session Storage
    • Memory-based Session Storage
    • Asynchronous File-Based Session Storage
    • Pluggable Session Storage
  • Advanced Programming
    • Thread Safety
    • Session Initialization and Binding
    • Session States
    • Listening to Session Events
    • Handling NotApplied Messages
    • Handling Business Reject Messages
    • Automated Downloading of GTC and GTD Orders
    • Reconnection
    • Fault Tolerance
    • Understanding Send Latency
    • Strongly Typed Messages
  • Best Practices
    • Low Latency Best Practices
  • Glossary
  • Support

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 InboundApplicationMessage event.

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.

Example

session.InboundApplicationMessage += (sender, args) =>
{
    const int BusinessRejectTemplateId = 521;
    const int BusinessRejectReasonTag = 380;
    const int RefSeqNumTag = 45;
    if (args.Message.TemplateID == BusinessRejectTemplateId)
    {
        Console.WriteLine($"Received: {args.Message}");
        Console.WriteLine($"\tReject reason: {args.Message.GetUnsignedShort(BusinessRejectReasonTag)}");

        if (args.Message.Contains(RefSeqNumTag))
        {
            Console.WriteLine($"\tThe sequence number of the rejected message is {args.Message.GetUnsignedInteger(RefSeqNumTag)}");
        }
        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)sender).OutSeqNum--;
        }
    }
};
In This Article
Back to top Copyright © Onix Solutions.
Generated by DocFX