Details
-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Engine
-
Labels:None
Description
Desc:
i have a quickfix config (for initiator), which doesn't have sender comp id. from my application i get the sender comp id at runtime, which i then set it session settings object. i then create SocketInitiator, and start the initiator. in the onCreate() method, i get sessionID without the sender comp id. am i trying which is not possible? please let me know if i am doing something wrong.
Code:
public boolean initialize(String senderCompID){
SessionSettings settings = null;
try
catch (ConfigError e)
{ System.err.println("Could not find FIX setting file."); e.printStackTrace(); System.exit(-1); } String fixVersion = null;
String sndrCompId = senderCompID;
settings.setString(SessionSettings.SENDERCOMPID, senderCompID); // sender compid added in the default session. also tried adding the same in NONE default session in the below lines of code.
String tgtCompId = null;
SessionID sessID;
Iterator<SessionID> ite = settings.sectionIterator();
while(ite.hasNext()) {
sessID = ite.next();
try
catch (Exception e)
{ System.err.println("Could not get [BEGINSTRING] or [TARGETCOMPID] " + "from session id [" + sessID.toString() + "]-[" + e.toString() + "]"); }}
String fileStorePath;
String fileLogPath;
try
catch (Exception e)
{ fileStorePath = null; System.err.println("Could not get [FileStorePath] [" + e.toString() + "]"); } try {
fileLogPath = settings.getString("FileLogPath");
if(fileStorePath == null)
} catch (Exception e)
{ fileLogPath = null; System.err.println("Could not get [FileLogPath] [" + e.toString() + "]"); } MessageStoreFactory storeFactory = new FileStoreFactory(settings);
LogFactory logFactory = new FileLogFactory(settings);
MessageFactory messageFactory = new MessageFactory();
try
catch (ConfigError e)
{ System.err.println("FIXClient Could not initiate socket!"); e.printStackTrace(); System.exit(-1); }String fixedString = fixVersion + "" + sndrCompId + "" + tgtCompId; // if i check my settings object i have sender comp id correctly inserted
// further code
initiator.start();
}