So i have to connect to two(2) sessions (same host different ports) so i used two different initiator

    application = Application()

    settings = quickfix.SessionSettings(config_file)  # stream settings
    storefactory = quickfix.FileStoreFactory(settings)
    logfactory = quickfix.FileLogFactory(settings)
    initiator = quickfix.SocketInitiator(
        application, storefactory, settings, logfactory)

    initiator.start()

    application.run()

    initiator.stop()

and used two different config (.cfg) files for both sessions

# This is a client (initiator)
[DEFAULT]
DefaultApplVerID=FIX.4.4
 #settings which apply to all the Sessions.
ConnectionType=initiator
 # FIX messages have a sequence ID, which shouldn't be used for uniqueness as specification doesn't guarantee anything about them. If Y is provided every time logon message is sent, server will reset the sequence.
FileLogPath=./Logs/
 #Path where logs will be written
StartTime=00:00:00
 # Time when session starts and ends
EndTime=00:00:00
UseDataDictionary=Y
 #Time in seconds before your session will expire, keep sending heartbeat requests if you don't want it to expire
ReconnectInterval=60
LogoutTimeout=5
LogonTimeout=30
 # Time in seconds before reconnecting
ResetOnLogout=N
ResetOnDisconnect=N
SendRedundantResendRequests=Y
# RefreshOnLogon=Y
SocketNodelay=N
# PersistMessages=Y
ValidateUserDefinedFields=N
ValidateFieldsOutOfOrder=N
# CheckLatency=Y



# session stream
[SESSION]
ResetOnLogon=Y
BeginString=FIX.4.4
SenderCompID=TESTING1
TargetCompID=TESTACC1
HeartBtInt=30
SocketConnectPort=4000
SocketConnectHost=127.0.0.1
DataDictionary=./spec/FIX44.xml
FileStorePath=./Sessions/

# session market
[SESSION]
ResetOnLogon=Y
BeginString=FIX.4.4
SenderCompID=TESTING2
TargetCompID=TESTACC2
HeartBtInt=30
SocketConnectPort=5000
SocketConnectHost=127.0.0.1
DataDictionary=./spec/FIX44.xml
FileStorePath=./Sessions/

But this doesn’t work

I saw a post where they recommended using ThreadedSocketInitiator but i don’t think its used on the python quickfix lib.

Thanks in advance

5