问题
Need to understand if my initiator received a message but crashed inside onMessage function, will I still restart with reset the sequence number that I was processing while crashing, and receives it again? so I don't lose the message? At what point does the seqnum got incremented, when the process goes out of the onMessage function?
回答1:
As per code if QuickfixJ, it increments the nextSeqNum to received after processing of onMessage callback. So if there is an exception in onMessage then nextSeqNum to received would not be incremented. Then while receiving the next message, there would be a gap in sequence number and Quickfixj will automatically send the resend request.
You can go through the code, here: https://github.com/quickfix-j/quickfixj
You can still change the behavior using config: "RejectMessageOnUnhandledException
for documentation please refer: https://www.quickfixj.org/usermanual/1.6.1/usage/configuration.html
Let me know if you need more guidance.
来源:https://stackoverflow.com/questions/50651556/if-quickfixj-crash-in-onmessage-will-i-lose-my-current-message