|
From: Felipe W. <fel...@gm...> - 2024-03-17 13:23:38
|
Dear QuickFIX/J community, I am seeking advice on how to manage messages from a drop copy session. Each business message must be processed by a separate application, and I need to ensure that every message is processed without fail. I am considering how to handle scenarios where, during the execution of the fromApp() method, calling this external application results in an error. Is it feasible to pause the processing of my FIX messages until the external call is successful? In such a scenario, the pending messages would accumulate. Would this approach be advisable? Additionally, I am curious about the mechanisms available for halting QFJ processing in response to an error encountered within the fromApp() method. Specifically, how can I effectively stop the processing of messages by QFJ at this juncture? Would it involve rejecting the problematic FIX message, thereby necessitating its resending by the FIX counterparty? I have contemplated the following strategies: 1. 1. Utilizing the QFJ Incoming Log: My idea is to configure the QFJ application to solely receive and log FIX messages. A separate application would then periodically (every 1 minute) check this log, guided by a control table that tracks the last sequence number processed. It would then process the messages accordingly. Point of Attention: As Christoph John has elucidated on StackOverflow <https://stackoverflow.com/a/78167504/11110455>, *"QFJ logs messages upon receipt at AbstractIoHandler.java <https://github.com/quickfix-j/quickfixj/blob/d7c9fe52fabdc56f28ace4063f6ac78fe422b511/quickfixj-core/src/main/java/quickfix/mina/AbstractIoHandler.java#L142>. Message parsing and subsequent processing occur later; only then is the message conveyed to the Session class where it undergoes validation, leading to a potential call to fromApp() if validation is successful."* Consequently, there's an inherent uncertainty about processing solely valid messages. 2. 3. 2. Employing a Message Broker: Another approach is to leverage a message broker as an intermediary in the fromApp() method to queue the received messages. This would essentially serve as a buffer, allowing another application to process these messages asynchronously. Point of Attention: A critical consideration is the strategy to adopt if the message broker becomes unavailable during the execution of a fromApp() method call. 4. 5. 3. Storing Pending Messages in a Database Table: Similar to using a message broker, this method involves storing the messages received in the fromApp() method in a database table. This table would then act as a buffer until the messages can be processed. I greatly appreciate your insights and suggestions on these approaches or any other potential solutions you might recommend. Thank you, Felipe Windmoller |