4

I can configure multiple sessions in a single QuickFIX/J settings file and then start them all with a single SocketInitiator. But I would like to be able to modify the configuration of one or more sessions and then restart just those sessions without affecting any others.

I could do this by having multiple settings files and using one SocketInitiator per session. But it seems as though QuickFIX/J is not intended to be used this way. Would it cause me any problems?

Christoph John
  • 3,003
  • 2
  • 13
  • 23
KevinS
  • 7,715
  • 4
  • 38
  • 56

1 Answers1

4

It is perfectly fine to start up an Initiator per session. It is a matter of taste. In any case: having a separate Initiator per session is independent and will not affect the other sessions.

If you want to follow the approach with a single Initiator then you could try to add/remove sessions dynamically via createDynamicSession()/removeDynamicSession(). There still is some manual work though.

  1. Find the Session that you want to reload. logout() and close() it.
  2. Call removeDynamicSession() for that Session.
  3. Get the settings for the SessionID that you want to reload from the running Initiator. Remove these from the running Initiator via removeSetting().
  4. Then reload the settings from the settings file for the needed Session and put them to the settings of the Initiator.
  5. Then call createDynamicSession() for the SessionID
Christoph John
  • 3,003
  • 2
  • 13
  • 23
  • 1
    Hi @ChristophJohn, thanks so much. I'll give it a try with one initiator per session to start with. – KevinS May 06 '20 at 09:31