[QFJ-551] Sender comp id doesnt not get reflected while creating a session if given at runtime Created: 04/Aug/10  Updated: 04/Aug/10

Status: Open
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: hitesh Assignee: Unassigned
Resolution: Unresolved Votes: 0
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

{ settings = new SessionSettings(settingsFileName); }

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

{ fixVersion = settings.getString(sessID, SessionSettings.BEGINSTRING); tgtCompId = settings.getString(sessID, SessionSettings.TARGETCOMPID); //settings.setString(sessID, SessionSettings.SENDERCOMPID, senderCompID); // tried adding in one of the sessions. }

catch (Exception e)

{ System.err.println("Could not get [BEGINSTRING] or [TARGETCOMPID] " + "from session id [" + sessID.toString() + "]-[" + e.toString() + "]"); }

}

String fileStorePath;
String fileLogPath;
try

{ fileStorePath = settings.getString("FileStorePath"); }

catch (Exception e)

{ fileStorePath = null; System.err.println("Could not get [FileStorePath] [" + e.toString() + "]"); }

try {
fileLogPath = settings.getString("FileLogPath");
if(fileStorePath == null)

{ fileStorePath = fileLogPath; System.out.println("[FileStorePath] set to [FileLogPath] - [" + fileStorePath + "]"); }

} 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

{ initiator = new SocketInitiator(this, storeFactory, settings, logFactory, messageFactory); }

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();
}


Generated at Thu May 02 08:06:45 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.