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?

Community
  • 1
  • 1
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359

2 Answers2

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.

Ani
  • 111,048
  • 26
  • 262
  • 307
  • 1
    I was able to get the session object this way by using the following in Python: `session = fix.Session.lookupSession(sessionID)` – Jonathan Livni Nov 15 '11 at 12:47
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

Greg Sadetsky
  • 4,863
  • 1
  • 38
  • 48
Berto
  • 199
  • 2
  • 2