{{Quickfixn}} Quickfixn Digest, Vol 89, Issue 13

Matthijs de Z mldz at hotmail.com
Tue Apr 2 06:50:13 PDT 2019


Just so you know. Problem is fixed.
Changed Reset("MsgSeqNum out of sync"); in QuickFix.Session ==> internal void Next(MessageBuilder msgBuilder) to Reset("MsgSeqNum out of sync", _skipReset);
With: 
const string _skipReset = "SkipReset";
And:
        /// <summary>
        /// Send a logout, disconnect, and reset session state
        /// </summary>
        /// <param name="loggedReason">reason for the reset (for the log)</param>
        /// <param name="logoutMessage">message to put in the Logout message's Text field (ignored if null/empty string)</param>
        public void Reset(string loggedReason, string logoutMessage)
        {
            System.Diagnostics.Debug.WriteLine("In " + MethodBase.GetCurrentMethod().Name + ",loggedReason: " + loggedReason + ",logoutMessage: " + logoutMessage);
            if(this.IsLoggedOn)
                GenerateLogout(logoutMessage);
            Disconnect("Resetting...");
            if(!logoutMessage.Equals(_skipReset))
                state_.Reset(loggedReason);
        }

Did the job ;-)


-----Original Message-----
From: Quickfixn <quickfixn-bounces at lists.quickfixn.com> On Behalf Of quickfixn-request at lists.quickfixn.com
Sent: Friday, March 22, 2019 18:18
To: quickfixn at lists.quickfixn.com
Subject: Quickfixn Digest, Vol 89, Issue 13

Send Quickfixn mailing list submissions to
	quickfixn at lists.quickfixn.com

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
or, via email, send a message with subject or body 'help' to
	quickfixn-request at lists.quickfixn.com

You can reach the person managing the list at
	quickfixn-owner at lists.quickfixn.com

When replying, please edit your Subject line so it is more specific than "Re: Contents of Quickfixn digest..."


Today's Topics:

   1.  can't set MsgSeqNum (Matthijs de Z)


----------------------------------------------------------------------

Message: 1
Date: Fri, 22 Mar 2019 17:17:51 +0000
From: Matthijs de Z <mldz at hotmail.com>
To: "quickfixn at lists.quickfixn.com" <quickfixn at lists.quickfixn.com>
Subject: {{Quickfixn}} can't set MsgSeqNum
Message-ID:
	<AM0PR05MB6226E1FD8AD8E0E526E04CA3D0430 at AM0PR05MB6226.eurprd05.prod.outlook.com>
	
Content-Type: text/plain; charset="us-ascii"

Hi all,



Wonder if someone can help me out with a Reuters / REDI connection. FIX4.2



After an internet connection hiccup (short time disconnected), the sequence number was out of line.

For some reason, I don't receive the message in

public void OnMessage(QuickFix.FIX42.Logout msg, SessionID sessionID)



Therefore I do some checks in QuickFix.Session ==> internal void Next(MessageBuilder msgBuilder)


else if(!IsLoggedOn)
                {
                    if(MsgType.REJECT.Equals(msgType))
                    {
                        try
                        {
                            var msg = message.ToString().Replace("\u0001", "|");
                            if(msg.Contains("SEQUENCE NUMBER: Seq # ") && msg.Contains("is Lower Than Expected #"))
                            {

                                string[] msgArray = msg.Split('|');
                                string text = string.Empty;
                                for(int i = 0; i < msgArray.Length - 1; i++)
                                {
                                    if(msgArray[i].StartsWith("58="))
                                    {
                                        text = msgArray[i];
                                        break;
                                    }
                                }

                                string[] splittedSequenceWarning = text.Split(' ');

                                string foundExpectedNumber = splittedSequenceWarning[splittedSequenceWarning.Length - 1];

                                int expectedSeqNum = Convert.ToInt32(foundExpectedNumber); //represents the correct number

                                if(expectedSeqNum > 0)
                                {
                                    //both are required.
                                    NextSenderMsgSeqNum = expectedSeqNum;
                                    NextTargetMsgSeqNum = expectedSeqNum;
                                }
                                else
                                {
                                    Reset("MsgSeqNum out of sync");
                                }

                                Reset("MsgSeqNum out of sync"); //nodig voor reset
                                Logon();
                            }
                        }
                        catch(Exception ex)
                        {
                            ex = ex;//todo: LOG!
                        }
                    }
                    //else

                    Disconnect(string.Format("Received msg type '{0}' when not logged on", msgType));

                }



Followed by



Next();



At the end of the method.



For some reason, the sequence number doesn't get reset. Any thoughts on this?
Anyone familiar with the REDI FIX DropCopy system using quickfix/n?

Kind regards,



Matthijs





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20190322/7e0445c1/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Quickfixn mailing list
Quickfixn at lists.quickfixn.com
http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com


------------------------------

End of Quickfixn Digest, Vol 89, Issue 13
*****************************************


More information about the Quickfixn mailing list