pythonswigquickfixpython-bindings

Quickfix - Set sequence number in Python


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?


Solution

  • 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.