I’m implementing app for integration over Fix protocol using QuickFixJ lib.

There will be two sessions with service provider. First needs ResetOnLogon=Y and second ResetOnLogon=N.

I tried this config:

[default]
FileStorePath=target/data/barxfx
BeginString=FIX.4.2
ConnectionType=initiator
SocketConnectHost=123.123.123.123
StartTime=00:00:00
EndTime=00:00:00
HeartBtInt=120
ReconnectInterval=120
TimeStampPrecision=SECONDS

[session]
SenderCompID=A-PRICES-TEST
TargetCompID=B-PRICES-TEST
SocketConnectPort=62345
ResetOnLogon=Y
ResetOnDisconnect=Y

[session]
SenderCompID=A-TRADES-TEST
TargetCompID=B-TRADES-TEST
SocketConnectPort=62346
ResetOnLogon=N
ResetOnDisconnect=N

Init code:

 InputStream inputStream = getClass().getResourceAsStream("/testfix.cfg");

SessionSettings settings = new SessionSettings(inputStream);
inputStream.close();

Application application = new QuickFixApplication();

MessageStoreFactory messageStoreFactory = new FileStoreFactory(settings);

LogFactory logFactory = new SLF4JLogFactory(settings);

MessageFactory messageFactory = new quickfix.fix42.MessageFactory();

SocketInitiator initiator = new SocketInitiator(application, messageStoreFactory, settings, logFactory, messageFactory);
initiator.start();

But it won’t work – as ResetOnLogon is being overwritten by the last session on the list and this setting is being used for two sessions.

Any ideas how to customize ResetOnLogon per session?

9