Rampal Chaudhary
Rampal Chaudhary

Reputation: 707

Quickfix Which has higher priority: message header or sessionID?

If i send A quickfix message using

FIX::Session::sendToTarget(FIX::Message, FIX::SessionID)

Then suppose in header of message:

sender Comp ID = s1, target CompID = t1

and in the SessionID variable:

sender Comp ID = s1, target CompID = t2

Will the message go to t1 or t2

Upvotes: 2

Views: 228

Answers (1)

Frank Smith
Frank Smith

Reputation: 988

It will use the session ID you specify in the sendToTarget call. From the QF source code...

bool Session::sendToTarget( Message& message, const SessionID& sessionID )
throw( SessionNotFound )
{
  message.setSessionID( sessionID );
  Session* pSession = lookupSession( sessionID );
  if ( !pSession ) throw SessionNotFound();
  return pSession->send( message );
}

Notice that the message session ID is immediately overwritten by the sessionID passed to the function.

Upvotes: 2

Related Questions