Ejemplo n.º 1
0
        public virtual void OnMessage(QuickFix.FIX44.ApplicationMessageReport message, SessionID session)
        {
            try
            {
                string[] quebraApplReqID   = message.ApplReqID.ToString().Split("|".ToCharArray());
                string   applReqID         = quebraApplReqID[0];
                string   sessionIDResponse = quebraApplReqID[1];

                // Retorna o applReqID original
                message.Set(new QuickFix.Fields.ApplReqID(quebraApplReqID[0]));

                // Inverte origem e destino da mensagem, para devolver a resposta ao cliente Fix
                message.Header.SetField(new QuickFix.Fields.SenderCompID(_dctSessionsFixClients[sessionIDResponse].TargetCompID));
                message.Header.SetField(new QuickFix.Fields.SenderSubID(_dctSessionsFixClients[sessionIDResponse].TargetSubID));
                message.Header.SetField(new QuickFix.Fields.TargetCompID(_dctSessionsFixClients[sessionIDResponse].SenderCompID));
                message.Header.SetField(new QuickFix.Fields.TargetSubID(_dctSessionsFixClients[sessionIDResponse].SenderSubID));

                logger.InfoFormat("SessionID[{0}]: ApplicationMessageReport enviando para sessionIDResponse[{1}] msg[{2}]",
                                  session.ToString(), sessionIDResponse, message.ToString());
                bool bRet = Session.SendToTarget(message, _dctSessionsFixClients[sessionIDResponse]);
                if (!bRet)
                {
                    logger.ErrorFormat("SessionID[{0}]: Falha ApplicationMessageReport sessionIDResponse[{1}] msg[{2}]",
                                       session.ToString(), sessionIDResponse, message.ToString());
                }
            }
            catch (Exception ex)
            {
                logger.Error("onMessage(ApplicationMessageReport): " + ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
 public virtual void OnMessage(QuickFix.FIX44.ApplicationMessageReport message, SessionID session)
 {
     try
     {
         logger.DebugFormat("ApplicationMessageReport ApplReqID[{0}] msg[{1}]", message.ApplReqID.ToString(), message.ToString());
     }
     catch (Exception ex)
     {
         logger.Error("onMessage(ApplicationMessageReport): " + ex.Message, ex);
     }
 }