2

I have two Fix Sessions with identical SessionIDs (this can't be changed, since the server side specifies the values for SenderCompID and TargetCompID). I learnt that I can use a SessionQualifier in the config file to disambiguate the two Sessions.

#config for session 1
SenderCompID=Sender
TargetCompID=Target
SessionQualifier=FirstSession
......

#config for session 2
SenderCompID=Sender
TargetCompID=Target
SessionQualifier=SecondSession
......

Now when I were to send a message via a particular session,

QuickFix.Session.SendToTarget(msg, sessionID);
//where sessionID = "FIX.4.4:Sender->Target" which is identical for both sessions

what should I do to tell the computer to send it through which session?

yu quan
  • 161
  • 1
  • 1
  • 14
  • Apparently even if I separate the two sessions into two IApplication, the static method Session.SendToTarget() will still send the same message two each of the two sessions. To the method SendToTarget, the two sessions are identical. – yu quan Feb 14 '18 at 11:18

1 Answers1

1

I'm not sure about quickfixn, but quickfixj has several constructors for SessionID, including:

public SessionID(String beginString, String senderCompID, String targetCompID, String qualifier)

So if you want to send message to one of session, you need to construct SessionID with qualifier like:

SessionID session1 = new SessionID("FIX.4.4", "Sender", "Target", "FirstSession");
QuickFix.Session.SendToTarget(msg, session1);
SessionID session2 = new SessionID("FIX.4.4", "Sender", "Target", "SecondSession")
QuickFix.Session.SendToTarget(msg, session2);
Yuriy Alevohin
  • 941
  • 7
  • 18