public MarketIncrementalProcessor(ChannelUMDFState state, ChannelUMDFConfig config, MonitorConfig monitorConfig) : base(config.MDIncrementalHost, config.MDIncrementalPorta, config.TemplateFile, config.ChannelID, config.LocalInterfaceAddress) { this.channelConfig = config; this.channelState = state; this.processorType = ProcessorType.MarketIncremental; this.monitorConfig = monitorConfig; ProcessamentoMensagensEnabled = false; ProcessamentoMensagensLockObject = new object(); ReplayLockObject = new object(); logger = LogManager.GetLogger("MarketIncrementalProcessor-" + config.ChannelID); MDSUtils.AddAppender("MarketIncrementalProcessor-" + config.ChannelID, logger.Logger); //if (int.Parse(channelConfig.ChannelID) <= 10) // tcpReplayBMF = TCPReplayBMF.GetInstance(this, channelConfig, config.TemplateFile, qUdpPkt, ReplayLockObject); //else // tcpReplayBovespa = new TCPReplayBovespa(this, channelConfig, config.TemplateFile, qUdpPkt, ReplayLockObject); //if (channelConfig.IsPuma) // tcpReplayBMF = TCPReplayBMF.GetInstance(this, channelConfig, config.TemplateFile, qUdpPktReplay, ReplayLockObject); //else // tcpReplayBovespa = new TCPReplayBovespa(this, channelConfig, config.TemplateFile, qUdpPktReplay, ReplayLockObject); fixInitiator = new FixInitiator(this, channelConfig, config.TemplateFile, qUdpPktReplay, ReplayLockObject); }
public MarketRecoveryProcessor(ChannelUMDFState state, ChannelUMDFConfig config, MonitorConfig monitorConfig) : base(config.MDRecoveryHost, config.MDRecoveryPorta, config.MDRecoveryHostSec, config.MDRecoveryPortaSec, config.TemplateFile, config.ChannelID, config.LocalInterfaceAddress) { this.channelConfig = config; this.channelState = state; this.processorType = ProcessorType.MarketRecovery; this.monitorConfig = monitorConfig; logger = LogManager.GetLogger("MarketRecoveryProcessor-" + config.ChannelID); MDSUtils.AddAppender("MarketRecoveryProcessor-" + config.ChannelID, logger.Logger); }
public SecurityListProcessor(ChannelUMDFState state, ChannelUMDFConfig config, MonitorConfig monitorConfig) : base(config.SecurityListHost, config.SecurityListPorta, config.SecurityListHostSec, config.SecurityListPortaSec, config.TemplateFile, config.ChannelID, config.LocalInterfaceAddress) { this.channelConfig = config; this.channelState = state; this.processorType = ProcessorType.SecurityList; this.monitorConfig = monitorConfig; logger = LogManager.GetLogger("SecurityList-" + config.ChannelID); MDSUtils.AddAppender("SecurityList-" + config.ChannelID, logger.Logger); }
public FixInitiator(MarketIncrementalProcessor mktIncProc, ChannelUMDFConfig channelUmdfConfig, string templateFile, Queue <UdpPacket> qUdpPkt, Object replayLockObject) { logger = LogManager.GetLogger("FixInitiator-" + channelUmdfConfig.ChannelID); MDSUtils.AddAppender("FixInitiator-" + channelUmdfConfig.ChannelID, logger.Logger); XMLMessageTemplateLoader loader = new XMLMessageTemplateLoader(); registry = UmdfUtils.loadTemplates(templateFile); context = new Context(); context.TemplateRegistry = registry; _mktIncProc = mktIncProc; _channelUmdfConfig = channelUmdfConfig; if (!listaChannelQueues.ContainsKey(channelUmdfConfig.ChannelID)) { listaChannelQueues.Add(channelUmdfConfig.ChannelID, new ListChannelQueues(qUdpPkt, replayLockObject)); } logger.Info("Start(): iniciando sessao FIX..."); try { // Cria sessao FIX _session = new QuickFix.SessionID( _channelUmdfConfig.TCPConfig.BeginString, _channelUmdfConfig.TCPReplayConfig.SenderCompID, _channelUmdfConfig.TCPReplayConfig.SubID, _channelUmdfConfig.TCPReplayConfig.TargetCompID, _channelUmdfConfig.TCPReplayConfig.SubID); // Cria dicionario da configuracao QuickFix.Dictionary mainDic = new QuickFix.Dictionary(); mainDic.SetLong("SocketConnectPort", _channelUmdfConfig.TCPReplayConfig.SocketConnectPort); mainDic.SetLong("HeartBtInt", _channelUmdfConfig.TCPConfig.HeartBtInt); mainDic.SetLong("ReconnectInterval", _channelUmdfConfig.TCPConfig.ReconnectInterval); mainDic.SetBool("ResetOnLogon", _channelUmdfConfig.TCPConfig.ResetOnLogon); mainDic.SetBool("ResetOnLogout", _channelUmdfConfig.TCPConfig.ResetOnLogout); mainDic.SetBool("ResetOnDisconnect", _channelUmdfConfig.TCPConfig.ResetOnDisconnect); mainDic.SetBool("PersistMessages", _channelUmdfConfig.TCPConfig.PersistMessages); mainDic.SetString("ConnectionType", _channelUmdfConfig.TCPConfig.ConnectionType); mainDic.SetString("SocketConnectHost", _channelUmdfConfig.TCPReplayConfig.SocketConnectHost); mainDic.SetString("FileStorePath", _channelUmdfConfig.TCPConfig.FileStorePath); mainDic.SetString("FileLogPath", _channelUmdfConfig.TCPConfig.FileLogPath); mainDic.SetString("StartTime", _channelUmdfConfig.TCPReplayConfig.StartTime); mainDic.SetString("EndTime", _channelUmdfConfig.TCPReplayConfig.EndTime); QuickFix.Dictionary sessDic = new QuickFix.Dictionary(); sessDic.SetString("BeginString", _channelUmdfConfig.TCPConfig.BeginString); sessDic.SetString("SenderCompID", _channelUmdfConfig.TCPReplayConfig.SenderCompID); sessDic.SetString("SenderSubID", _channelUmdfConfig.TCPReplayConfig.SubID); sessDic.SetString("TargetCompID", _channelUmdfConfig.TCPReplayConfig.TargetCompID); sessDic.SetString("TargetSubID", _channelUmdfConfig.TCPReplayConfig.SubID); sessDic.SetString("DataDictionary", _channelUmdfConfig.TCPConfig.DataDictionary); sessDic.SetBool("UseDataDictionary", true); // Configure the session settings QuickFix.SessionSettings settings = new QuickFix.SessionSettings(); settings.Set(mainDic); settings.Set(_session, sessDic); MemoryStoreFactory store = new MemoryStoreFactory(); FileLogFactory log = new FileLogFactory(settings); IMessageFactory message = new DefaultMessageFactory(); // Cria o socket _initiator = new QuickFix.Transport.SocketInitiator(this, store, settings, log, message); _initiator.Start(); } catch (Exception ex) { logger.Error("Start():" + ex.Message, ex); } logger.Info("Start(): Sessao FIX iniciado!"); }
public ChannelUDMF(ChannelUMDFConfig config, MonitorConfig monitorConfig) { channelState = new ChannelUMDFState(); channelConfig = config; this.monitorConfig = monitorConfig; }
public TCPReplayBovespa(MarketIncrementalProcessor mktIncProc, ChannelUMDFConfig channelConfig, string templateFile, Queue <UdpPacket> qUdpPkt, Object replayLockObject) : base(mktIncProc, channelConfig, templateFile, qUdpPkt, replayLockObject) { }
public static TCPReplayBMF GetInstance(MarketIncrementalProcessor mktIncProc, ChannelUMDFConfig channelConfig, string templateFile, Queue <UdpPacket> qUdpPkt, Object replayLockObject) { if (_me == null) { lock (_mutex) { if (_me == null) { _me = new TCPReplayBMF(mktIncProc, channelConfig, templateFile, qUdpPkt, replayLockObject); } } } return(_me); }