Search code examples
quickfixj

Issue receiving messages in the fromApp method after sending a Quote Request Reject (35=AG)


I have an application that uses QuickFix version 4.4. In this application, we receive a Quote Request (35-R) and perform some validations. If any of the validations are not met, the application issues a Quote Request Reject (35-AG). The problem arises when this scenario occurs: subsequent Quote Requests (35-R) are not received by the fromApp method for processing, as if the application were blocked (although it continues to return administrative messages normally: fromAdmin and toAdmin). After a certain period, which can vary from 1 to 10 minutes, the application resumes normal processing. It's important to note that the Quote Request messages that are not processed by the fromApp method are still recorded in the database (JdbcLogIncomingTable) without any issues.


Solution

  • I collaborate with @Adan Vinicius

    Troubleshooting the Issue

    During our investigation, we discovered the following sequence of events:

    1. We sent a 35=AG (Request Reject) message.
    2. In response, we received a 35=Z (Quote Cancel) message.
    3. While processing the 35=Z message, our application encountered a NullPointerException. Consequently, QuickFIX/J (QFJ) was unable to store this sequence number message in its FIX session control.

    Handling the Missing Message

    When we subsequently received a 35=R (Quote Request) message, QFJ automatically sent a 35=2 (Resend Request). From QFJ’s perspective, a message was missing.

    Interestingly, the 35=R message was successfully stored in the QFJ log. However, our fromApp() method in our Application object was not being executed. This discrepancy caused confusion.

    QFJ Flow and Handling Invalid Messages

    We made an important observation: when QFJ identifies an invalid message (such as an incorrect sequence number), it still persists that message in the QFJ log. However, the fromApp() method is not executed.