1

I use the Python bindings that come with Quickfix and I'd like to set the sequence number through it (see why). How can I do this?

I found the following in the SWIG bindings:

class Session(_object):
    # ...
    def setNextSenderMsgSeqNum(self, *args): return _quickfix.Session_setNextSenderMsgSeqNum(self, *args)
    # ...

It requires two parameters: a Session object and an int sequence number.
How can I get the Session object?
Or is there another method of setting the sequence number?

2 Answers 2

1

Odds are you have a reference to a SessionID object associated with the session (for example, by caching the session-Id given to you in the Application.onCreate method when the session is created) . In this case, you can use the Session.lookupSession method to look the session up from the SessionID. If you don't, you can construct a SessionID first from the BeginString, SenderCompID and TargetCompID of the session you are interested in.

Sorry, but I don't know Python - so I can't provide you with an example.

Sign up to request clarification or add additional context in comments.

1 Comment

I was able to get the session object this way by using the following in Python: session = fix.Session.lookupSession(sessionID)
0

Ok, nevermind, i got it... need to figure out how to read from log but in

def onCreate(self, sessionID):
    self.sessionID = sessionID 
    self.session = fix.Session.lookupSession(self.sessionID)
    print self.session
    n = 14088
    self.session.setNextSenderMsgSeqNum(n)

this worked

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.